Configure JDK 1.8.0 _ 25 in Ubuntu 14.04 and switch the version.
Configure jdk 1.8.0 _ 25 in Ubuntu 14.04. You can switch the version to jdk.
Decompress:
Sudo mkdir/usr/lib/jvm
Sudo tar zxvf/home/user name/Downloads/jdk-8u25-linux-i586.tar.gz-C/usr/lib/jvm
Modify the environment variable: // The environment variable is not configured after the test. After the configuration, the following command cannot be used to switch the version.
Test method: Hadoop-2.6.0 with jdk1.8.25 compilation will be wrong, but with openjdk will not, by setting different versions, indeed when the 1.8.25 error occurs, so do not configure here.
Sudo gedit/etc/profile
# Set java environment
Export JAVA_HOME =/usr/lib/jvm/jdk1.8.0 _ 25
Export JRE_HOME =$ {JAVA_HOME}/jre
Export CLASSPATH =. :$ {JAVA_HOME}/lib :$ {JRE_HOME}/lib
Export PATH =$ {JAVA_HOME}/bin: $ PATH
Save and exit. Enter the following command to make it take effect immediately.
Configure the default JDK:
Sudo update-alternatives -- install/usr/bin/java/usr/lib/jvm/jdk1.8.0 _ 25/bin/java 300
Sudo update-alternatives -- install/usr/bin/javac/usr/lib/jvm/jdk1.8.0 _ 25/bin/javac 300
// Do not configure the following two items
Sudo update-alternatives -- install/usr/bin/javah/usr/lib/jvm/jdk1.8.0 _ 25/bin/javah 300
Sudo update-alternatives -- install/usr/bin/jar/usr/lib/jvm/jdk1.8.0 _ 25/bin/jar 300
// Version switch command
Sudo update-alternatives -- config java
Sudo update-alternatives -- config javac
Test
Java-version
Javac-version
Install JDK 1.8.0 _ 25 on Ubuntu 14.04 and configure Environment Variables
Build a JDK environment using CentOS
Install JDK 1.8.0 _ 25 on Ubuntu 14.04 and configure Environment Variables
Install Oracle JDK 14.04 on Ubuntu 1.8 LTS
CentOS6.3 install JDK and environment Configuration
Install JDK 8 on Ubuntu 14.04
Install JDK graph analysis in Ubuntu