Sudo update-alternatives -install /usr/bin/javac javac /home/xxxx/java/jdk1.8.0_201/bin/javac 20000 sudo update-alternatives -install /usr/bin/java java /home/xxxx/java/jdk1.8.0_201/bin/java 20000 Let Ubuntu know where our JDK/JRE is located. Set path JAVA_HOME=path of your jdk folder(open jdk folder then right click on any folder, go to properties then copy the path using select all) like: /home/java(Folder name created by user in home directory). Download java jdk-linux-圆4.tar.gz file from.