ubuntu14.04 manual installation of Java JDK the first step: Download the jdk.tar.gz (assuming that the downloaded file name is jdk.tar.gz) Step two: Extract sudo tar-zxvf. Jdk.tar.gz here will be in the current directory will be to a new extracted folder (JDK-8XXX), here is assumed to be the folder called JDK Step three: Move the extracted folder sudo MKDIR/USR/LIB/JVM New Folder Jvmsudo mv./jdk/usr/lib/jvm/java Fourth Step: Modify the environment variable sudo gedit/etc/environment if the file has not been modified before, there should be only one line (the second line after this modification), if so, After this modification there will be three lines to add the first line javahome= "/usr/lib/jvm/java" is added before the last quotation mark in the second line:/usr/lib/jvm/java/bin:/usr/lib/jvm/java/jre/bin The second line is modified to this form: path= "****:/usr/lib/jvm/java/bin:/usr/lib/jvm/java/jre/bin" where xxxx is the contents of the double quotes before you, avoid the complete copy of this form to add the third line: Classpath= ".:/ Usr/lib/jvm/java/lib:/usr/lib/jvm/java/jre/lib "Use environment variables now: source/etc/environment Other work: Then set the default JDK, Because the system default may exist other JDK in Terminal execution command: sudo update-alternatives--install/usr/bin/java java/usr/lib/jvm/java/bin/java 300sudo Update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/java/bin/javac 300 Select system default JDK, execute command at Terminal: sudo Update-alternatives--config Java If there is only one Java environment then there will be a prompt system with only one JDK final execution command: java-version
Install Java JDK manually under ubuntu14.04