Installing the JDK on Linux is one of the most essential technologies for programmers who choose to develop applications under Linux, and here I use Ubuntu demo to install Jdk1.7 under Linux using the command line (graphical interface is not considered!!!). )
First step: Install the virtual machine
Step Two: Install Ubuntu
Step three: Install the JDK
Resources: Ubuntu 10 (my 32-bit machine, everyone attention to the seat)
Linux ubuntu 2.6.35-22-generic #33-ubuntu SMP Sun Sep 20:34:50 UTC i686 gnu/linux
Jdk1.7 version
Jdk-7u9-linux-i586.tar.gz
(1), JDK people generally like to use it as a system application, so generally everyone likes to set up a new folder under the/usr/--java for storing the path of the Java installation
Action command: sudo mkdir/usr/java
(3), unzip the jdk-7u9-linux-i586.tar.gz and place it in the/usr/java directory and then rename it to jdk1.7
Extract command: sudo tar-zxvf-r jdk-7u9-linux-i586.tar.gz//usr/java
Rename command: sudo mv jdk1.7.0_09 jdk1.7
(4), configure environment variables
Go to config file: sudo gedit/etc/profile
Add a configuration file before Umask 022
export JAVA_HOME=/usr/java/jdk1.7 export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin 022
(5), and finally restart the client input java-version the message that appears is the success
nagi@ubuntu:~$ java -version "1.7.0_09" Java(TMSERuntimeEnvironment1.7.0_09-b05) JavaHotSpot(TMClientVM23.5-b02, mixed mode) nagi@ubuntu:~$
Installing JDK under Linux