Windows platform
1. Log in to the Oracle website (http://www.oracle.com/index.html) to find the download
2. Select the version you want to download and click JDK DOWNLOAD
3. Download the file, tick "Accept License agreement" and select the appropriate version to download
4. Install the installation files directly, it is recommended not to install in the Chinese directory, preferably not installed in a directory with spaces
Linux platform (Ubuntu for example)
1. Download the JDK and unzip it, such as unpacking the JDK to/opt/java.1.7.0
2. Modify the configuration file ~/.BASHRC, and then add the following code and Save:
Export java_home=/opt/java.1.7.0 export jre_home=${JAVA_HOME}/JRE export classpath=.:${java_home}/lib:${ jre_home}/Lib Export PATH=${java_home}/bin: $PATH
3. Make it effective immediately:
SOURCE ~/.BASHRC
4. In Terminal input:
sudo update-alternatives--install/usr/bin/java java/opt/java.1.7.0/bin/javasudo update-alternatives-- Install/usr/bin/javac Javac/opt/java.1.7.0/javac 300
The terminal input java-version appears in the format shown, the installation succeeds
Java Note Finishing (ii), downloading and installing the JDK