Transferred from: http://blog.csdn.net/tecn14/article/details/24797545
JDK is currently the latest version of Jdk-8u5, this time did not choose to install the latest jdk8, but to install jdk7 the highest version of jdk-7u55.
First, go to the official website to download jdk-7u55, address: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Select Accept License agreement, select the corresponding version of the download, Ubuntu Select tar.gz compression package, 64-bit x64,32 choose i586.
After the completion of the compression package: jdk-7u55-linux-x64.tar.gz, decompression and configuration can be used, do not need to install. I unzip the home directory, terminal execution: TAR-ZXVF jdk-7u55-linux-x64.tar.gz-c ~/,-C after the directory to be extracted to. Get folder: jdk1.7.0_55
Next set environment variables, terminal execution: sudo gedit/etc/environment
Add the Bin directory of the JDK after the existing path variable, and note that the colon is separated from the existing variable
Add Calsspath and Java_home variables again
My situation is as follows:
Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/tecn/ Jdk1.7.0_55/bin "
Classpath= "/home/tecn/jdk1.7.0_55/lib:." Look, there's a point back there.
Java_home= "/home/tecn/jdk1.7.0_55/"
When set, log off or restart to make the environment variable effective!
Check whether the terminal executes: java-version, you can see that the version is just configured 7u55.
The configuration is complete and can be written under a HelloWorld test.
Already installed OPENJDK to enable the official JDK:
Terminal execution in turn:
sudo update-alternatives--install/usr/bin/java Java/home/tecn/jdk1.7.0_55/bin/java 445
sudo update-alternatives--install/usr/bin/javac javac /home/tecn/jdk1.7.0_55/bin/javac 445
sudo update-alternatives--config java
You will be prompted to maintain the current value [*] press ENTER, or enter the selected number:
Enter the number of the item with the priority 445, enter it.
--------------------------------------------------------------------------------
Reprint Please specify:
Original address: http://blog.csdn.net/tecn14/article/details/24797545
--------------------------------------------------------------------------------
Ubuntu 14.04 Configuration Java SE jdk-7u55 (reprint)