Sudo update-alternatives –set javaws /usr/local/java/jdk1.7.0_80/bin/javawsĪfter you do the following commands, you should reload the profile by using Sudo update-alternatives –set javac /usr/local/java/jdk1.7.0_80/bin/javac Sudo update-alternatives –set java /usr/local/java/jdk1.7.0_80/bin/java Next, see if the Java version is installed already. First, we need to update the index of the package for installing this version.
In case that you have had already installed OpenJDK Java from the Ubuntu’s repository you would still need to add your new Oracle Java JDK 7 installation into the system’s environment with the above update-alternatives install command. The 20.04 version of Ubuntu by default includes the 11 version of OpenJDK and it is an open-source version of the JDK and JRE. Sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/local/java/jdk1.7.0_80/bin/javaws” 1 This confirms that the installation of Oracle Java JDK 7 on your Ubuntu Linux system was performed correctly. Sudo update-alternatives –install “/usr/bin/javac” “javac” “/usr/local/java/jdk1.7.0_80/bin/javac” 1 Sudo update-alternatives –install “/usr/bin/java” “java” “/usr/local/java/jdk1.7.0_80/bin/java” 1 To check if the files extracted correctly doĥ.Open /etc/profile in nano with sudo privileges and copy the following text at the bottom of the file (PageDown for quicker navigation to the bottom of the file):Ħ.After saving the file, the next thing you should do is the following commands, they will update all the paths to the openjdk-7: Let’s get started! 1.Open up a terminal (for most distros it’s Ctrl+Alt+T, but if yours doesn’t open one up, look up terminal in your application list)įor purposes of this tutorial I will be using a WSL 2 machine, but this applies to all Ubuntu/Debian derivatives.ģ.The next step is to create a directory in the locationĪnd copy the file we just downloaded thereĤ.What we need to do after copying the file is to enter the directory we previously created and extract the tarball we copied to it Ok, so to install OpenJDK 7, it’s a bit of a tricky process, but I hope my guide will assist you in achieving that. Now this error probably occured because you are using a openjdk that’s newer than OpenJDK version specific for your LineageOS version.Īs we can see in the official build guide from LineageOS Wiki, OpenJDK 1.7 is needed to build cm-13 and such)Īnd you have arrived at an error that looks something like thisĮrror: could not find jdk tools.jar, please check if your JDK was installed correctly. OpenJDK is the short form of Open Java Development Kit similar to Oracles Java Development Kit used to develop Java Applications.
If you’re viewing this page you have probably tried building an older version of lineage (i.e. In this guide, we will see how to download and install OpenJDK 6 on Ubuntu.