tom
tom

Reputation: 1493

Getting Java to work with Windows 10 Ubuntu

I installed the Windows 10 Anniversary Update so that I could try Bash on Ubuntu on Windows. See how to install it. I wanted to see how performant it was. I then installed the Oracle Java JDK as per this article, so I could compare compilation times with the native Windows Java compiler.

I then tried to run Maven on my project, but it didn't work. Maven just hung starting. I noticed in Task Manager that the "java" process was hovering around 92% CPU.

So I tried something simple. I created a dummy Java Hello-world-like class and attempted to compile it with javac. Similarly, the "javac" process sat around 92% CPU.

I thought maybe it had something to do with running headless, but the -Djava.awt.headless=trueoption didn't make it any better.

Has anyone got this to work or have anything to try?

Update:

I also tried installing the Open JDK instead of the Oracle JDK (via sudo apt-get install openjdk-7-jdk) with the same result.

Upvotes: 5

Views: 9034

Answers (2)

tom
tom

Reputation: 1493

I figured it out. I couldn't use the download directly from Oracle. Instead I had to install it as per this link. Here are the steps:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Upvotes: 3

gordon force
gordon force

Reputation: 21

I had the same experience with the Windows 10 Anniversary Update. The first Fast Track Insider Build after the Anniversary Update and later support both the oracle Java 8 installer and the open JDK 7 installer. I just verified the java -version command still works on Insider Preview Build 14951 161014-1700 from the Ubuntu subsystem's bash shell. I have run other JVM based tools from bash shell as well but not extensively.

Here is a link to an issue, Cannot install Oracle JDK 8 #315, describing both installation and JVM hang issues tracked by the BashOnWindows project.

Upvotes: 1

Related Questions