

Also, I found it a lot more straightforward to download the zips needed first and put them alongside the script. I used the script given by but he missed some things that the script depends on, and also copy/pasting the contents results in having windows line endings/carriage returns ( /r) which will need replacing to linux returns. 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 accept the license so that their js lets you copy the new URLs and you should be good to go. Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode) Java(TM) SE Runtime Environment (build 1.8.0_112-b15) Sudo echo "export J2SDKDIR=/usr/lib/jvm/oracle_jdk8Įxport J2REDIR=/usr/lib/jvm/oracle_jdk8/jreĮxport PATH=$PATH:/usr/lib/jvm/oracle_jdk8/bin:/usr/lib/jvm/oracle_jdk8/db/bin:/usr/lib/jvm/oracle_jdk8/jre/binĮxport JAVA_HOME=/usr/lib/jvm/oracle_jdk8Įxport DERBY_HOME=/usr/lib/jvm/oracle_jdk8/db" | sudo tee -a /etc/profile.d/oraclejdk.shĪnd now I can do the following java -version Sudo update-alternatives -install /usr/bin/javac javac /usr/lib/jvm/oracle_jdk8/bin/javac 2000 Sudo update-alternatives -install /usr/bin/java java /usr/lib/jvm/oracle_jdk8/jre/bin/java 2000 Mv UnlimitedJCEPolicyJDK8/US_export_policy.jar /usr/lib/jvm/oracle_jdk8/jre/lib/security/ Mv UnlimitedJCEPolicyJDK8/local_policy.jar /usr/lib/jvm/oracle_jdk8/jre/lib/security/

Wget -no-cookies -header "Cookie: oraclelicense=accept-securebackup-cookie" \ # Download Oracle Java 8 accepting the license you can use dos2unix or your preferred way of dealing with that. If you do not use a command line based editor such as vim then you will have windows line endings to deal with. You will need to install unzip sudo apt-get install unzipĬopy this script somewhere in your bash for windows session and make it executable (chmod +x filename). 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 Horton is correct.
