|
Ubuntu 14.04 configure JDK1.8.0_25, switchable version, jdk Download.
Decompression:
sudo mkdir / usr / lib / jvm
sudo tar zxvf / home / username /Downloads/jdk-8u25-linux-i586.tar.gz -C / usr / lib / jvm
Modify environment variables: // tested here may not be configured by the following command after the configuration can not be switched version.
Test Method: Hadoop-2.6.0 compiled with jdk1.8.25 be wrong, but does not use openjdk, by setting different versions, indeed 1.8.25 When an error occurs when setting, so no configuration 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 effective immediately.
Configure the default JDK:
sudo update-alternatives --install / usr / bin / java java /usr/lib/jvm/jdk1.8.0_25/bin/java 300
sudo update-alternatives --install / usr / bin / javac javac /usr/lib/jvm/jdk1.8.0_25/bin/javac 300
// You can not configure two behind
sudo update-alternatives --install / usr / bin / javah javah /usr/lib/jvm/jdk1.8.0_25/bin/javah 300
sudo update-alternatives --install / usr / bin / jar jar /usr/lib/jvm/jdk1.8.0_25/bin/jar 300
// Version handover command
sudo update-alternatives --config java
sudo update-alternatives --config javac
test
java -version
javac -version |
|
|
|