Java9 Series (2) docker Runs java9



This article introduces how to run java9 in docker.

mirror image

docker pull openjdk:9-jdk

Start up

docker run -it openjdk:9-jdk /bin/jshell

Then you can use jshell normally, for example

Sep 22, 2017 2:16:12 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
|  Welcome to JShell -- Version 9-Debian
|  For an introduction type: /help intro

jshell> Arrays.asList(1,2,3,4).stream().limit(3).forEach(e -> System.out.print(e))

retreat from

jshell> /exit
|  Goodbye

View the java version of this mirror

docker run -it openjdk:9-jdk /bin/bash
root@44d1d18351a8:/# java -version
openjdk version "9-Debian"
OpenJDK Runtime Environment (build 9-Debian+0-9b181-4)
OpenJDK 64-Bit Server VM (build 9-Debian+0-9b181-4, mixed mode)