Skip to content

Installing Oracle JDK on Windows subsystem for Linux

When trying to use the Linux version of Oracle’s JDK on the latest Windows 10 build having support for bash, I am running into a problem with the prompt hanging whenever attempting to invoke the java binary.

Typing even something as simple as java -version hangs and I have to terminate the process to resume control.

Anyone got this working yet?

Advertisement

Answer

I wanted to clarify that as of 9 December 2016, you most certainly can install Java 8 on Ubuntu Bash for Windows 10 and that @Karl Horton is correct.

You will need to install unzip sudo apt-get install unzip

Copy this script somewhere in your bash for windows session and make it executable (chmod +x filename). If you do not use a command line based editor such as vim then you will have windows line endings to deal with. you can use dos2unix or your preferred way of dealing with that. I just paste it into a file using vim.

JavaScript

And now I can do the following

JavaScript

The links and versions in the above script are likely to be out of date by the time you read this, so just head over to http://www.oracle.com/technetwork/java/javase/downloads/index.html accept the license so that their js lets you copy the new URLs and you should be good to go.

User contributions licensed under: CC BY-SA
6 People found this is helpful