|
The following are the Ubuntu 14.04 installation and configuration environment variable JDK1.8.0_25 procedure notes.
1. Source Package preparation:
First, the official website to download jdk, http: //www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html, I downloaded jdk-8u25-linux-x64.tar.gz, download it to your home directory
2, extract the source package
Through the new terminal at / usr / local directory java folder, the command line:
2, extract the source package
Through the new terminal at / usr / local directory java folder, the command line:
sudo mkdir / usr / local / java
And then downloaded to the archive folder are copied to the java command line:
Jdk source package into the directory
cp jdk-8u25-linux-x64.tar.gz / usr / local / java
Then enter java directory, the command line:
cd / usr / local / java
Extracting archive, the command line:
sudo tar xvf jdk-8u25-linux-x64.tar.gz
You can then delete the archive, the command line:
sudo rm jdk-8u25-linux-x64.tar.gz
3, set the environment variable jdk
Here the use of global settings method, which is common to all users of the environment variable
$ Sudo gedit ~ / .bashrc
After opening at the end add
export JAVA_HOME = / usr / local / java / jdk1.8.0_25
export JRE_HOME = $ {JAVA_HOME} / jre
export CLASSPATH =:. $ {JAVA_HOME} / lib: $ {JRE_HOME} / lib
export PATH = $ {JAVA_HOME} / bin: $ PATH
Remember to add the above procedure, do not include spaces on both sides of the equal sign, otherwise there will be "is not a valid identifier", because they can not recognize the extra time source / etc / profile to space, it will be understood to be part of the path.
Then save.
4. Verify that the installation was successful
Enter the following command in the terminal
java -version
To see if the installation was successful
Success is shown below |
|
|
|