Environment: Ubuntu12.04 installation: JDK1.7 + EclipseJunoServiceRelease1 + Tomcat7.0 environment configuration 1 installation and configuration JDK1.71. decompress the downloaded JDK. $: tar-xvf ~ /Downloads/jdk-7u3-linux-i586.tar.gz2. Create a directory to store JDK & nb
Environment: Ubuntu 12.04
Installation: JDK1.7 + Eclipse Juno Service Release 1 + atat7.0 environment Configuration
1. install and configure JDK1.7
1. decompress the downloaded JDK.
$: Tar-xvf ~ /Downloads/jdk-7u3-linux-i586.tar.gz
2. Create a directory to store JDK
$: Sudo mkdir-p/usr/lib/jvm/jdk1.7.0
3. Move the files under JDK to the new directory.
$: Sudo mv jdk1.7.0 _ 03/*/usr/lib/jvm/jdk1.7.0/
4. Create a default JDK startup
$: Sudo update-alternatives -- install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
$: Sudo update-alternatives -- install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
$: Sudo update-alternatives -- install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1
Now, JDK installation is complete.
Run the following code to view the current JDK versions and configurations:
$: Sudo update-alternatives -- config java
Show ---- there is only one candidate item in the Link Group java:/usr/lib/jvm/jdk1.7.0/bin/java
No configuration is required.
5. Set JDK Environment Variables
$: Sudo su
$: Vim/etc/environment
Add red part
PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/lib/jvm/jdk1.7.0/bin"
CLASSPATH = ".:/usr/lib/jvm/jdk1.7.0/lib"
JAVA_HOME = "/usr/lib/jvm/jdk1.7.0"
Save and exit
$: Sudo source ~ /. Bashrc (enable the setting to take effect without restarting)
$: Java-version
Display: java version "1.7.0 _ 09"
Java (TM) SE Runtime Environment (build 1.7.0 _ 09-b05)
Java HotSpot (TM) Server VM (build 23.5-b02, mixed mode)
Indicates that the installation is successful.