Ubuntu14.04 install and configure jdk7
1. Download:
Go to http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html to download the JDK. I am going to dk-7u55-linux-x64.tar.gz.
Default placed in/home/licheng/xiazai/jdk-7u55-linux-x64.tar.gz. Install non-system software in the/opt directory. [You can select the Directory and create the directory on your own. This is a path problem.] [use fty or SSH to upload the directory to the server]
2) decompress the file:Press Ctrl + Alt + T to open the terminal,Run
Sudo cp/home/licheng/xiazai/jdk-7u55-linux-x64.tar.gz/opt (copy the file to the opt folder)
Cd/opt (switch to opt)
Sudo tar-zxvf jdk-7u55-linux-x64.tar.gz (archive extracted files)
Run the ls command and you will see the jdk1.7.0 _ 55 folder under opt.
3) configure the java environment.Run
Sudo gedit/etc/profile (modify environment variables)
Add configuration at the end of the file, save and exit
# Set jdk environment
Export JAVA_HOME =/opt/jdk1.7.0 _ 55
Export CLASSPATH =.: $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib: $ CLASSPATH
Export PATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATH
4) check whether the configuration is successful.Open the terminal and enter
Source/etc/profile
Java-version
As shown below, the configuration is successful
Java version "1.7.0 _ 55"
Java (TM) SE Runtime Environment (build 1.7.0 _ 55-b13)
Java HotSpot (TM) 64-Bit Server VM (build 24.55-b03, mixed mode)