Ubuntu Server 12.04 installation JRE

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

1,The JRE version is the official release of the Oracle server JRE 7u21, download address: http://download.oracle.com/otn-pub/java/jdk/7u21-b11/server-jre-7u21-linux-x64.tar.gz?AuthParam=1369042105_ccb07d81f8301455441aae96ff455be1.


2,Upload JRE to user root directory.


3,Unzip the compressed package

tar –xzf server-jre-7u21-linux-x64.gz

Get a name for the jdk1.7.0_21 folder


4,The establishment of /usr/local/java directory

cd /usr/local

sudo mkdir java


5,~/jdk1.7.0_21 will be copied to the /usr/local/java directory

sudo mv ~/jdk1.7.0_21 /usr/local/java


6,Get into/usr/local/java

cd /usr/local/java


7,All the files under the /usr/local/java user and user group changed to root

sudo chown -R root .

sudo chgrp -R root .


8,A permanent increase in system environment variables

1,Gets the root permissions: sudo su -

2,The editor/etc/profile: vi /etc/profile

3,In the /etc/profile at the bottom, add the following commands:

JAVA_HOME=/usr/local/java/jdk1.7.0_21 #Note that the path

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,The effect of environmental variables

source /etc/profile


10,Inspection installation was successful

java –version

javac –version

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Hardy at November 08, 2013 - 11:54 AM