Skip to content

Instantly share code, notes, and snippets.

@koduki
Created September 5, 2016 19:00
Show Gist options
  • Save koduki/8fb43085f185a17ede68e4e41099dd83 to your computer and use it in GitHub Desktop.
Save koduki/8fb43085f185a17ede68e4e41099dd83 to your computer and use it in GitHub Desktop.
Dockerを使ってJava9を超高速に試す ref: http://qiita.com/koduki/items/c4fb0276cc0d9a1a08c0
$ docker run marvambass/oracle-java9 java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+130)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+130, mixed mode)
$ cat > Main.java
public class Main {
public static void main(String[] args){
System.out.println("Hello java9 on Docker");
}
}
$ ls Main.java
Main.java
$ docker run -v `pwd`:/tmp -w "/tmp" marvambass/oracle-java9 javac Main.java
$ ls -l Main.*
-rw-r--r-- 1 koduki 197609 423 9月 6 03:47 Main.class
-rw-r--r-- 1 koduki 197609 117 9月 6 03:47 Main.java
$ docker run -v `pwd`:/tmp -w "/tmp" marvambass/oracle-java9 java Main
Hello java9 on Docker
$ docker run -it marvambass/oracle-java9 jshell
Sep 05, 2016 6:52:03 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
| Welcome to JShell -- Version 9-ea
| For an introduction type: /help intro
jshell> System.out.println("Hello JShell!")
Hello JShell!
jshell>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment