UbuntuServer12.04 install JRE1, JRE version is officially released by Oracle serverjre72008,: http://download.oracle.com/otn-pub/java/jdk/7u21-b11/server-jre-7u21-linux-x64.tar.gz? AuthParam = 1369042105_ccb07d81f8301455441aae96f
Install JRE on Ubuntu Server 12.04
1. JRE version is officially released by Oracle server jre 72008,: http://download.oracle.com/otn-pub/java/jdk/7u21-b11/server-jre-7u21-linux-x64.tar.gz? AuthParam = 1369042105_ccb07d81f8301455441aae96ff455be1.
2. Upload the jre to the user root directory.
3. decompress the compressed package
Tar-xzf server-jre-7u21-linux-x64.gz
Get the folder named jdk1.7.0 _ 21.
4. Create/usr/local/java directory
Cd/usr/local
Sudo mkdir java
5. Change ~ /Jdk1.7.0 _ 21 copy to/usr/local/java directory
Sudo mv ~ /Jdk1.7.0 _ 21/usr/local/java
6. Access/usr/local/java
Cd/usr/local/java
7. Change the users and user groups of all files in/usr/local/java to root.
Sudo chown-R root.
Sudo chgrp-R root.
8. Add permanent system environment variables
1. Get the root permission: sudo su-
2. edit/etc/profile: vi/etc/profile.
3. Add the following command at the bottom of/etc/profile:
JAVA_HOME =/usr/local/java/jdk1.7.0 _ 21 # note the path here
Export JAVA_HOME
PATH = $ JAVA_HOME/bin: $ PATH
Export PATH
CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export CLASSPATH
4. Save and exit: esc: wq
9. Make the environment variable take effect
Source/etc/profile
10. Check whether the installation is successful.
Java-version
Javac-version
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2