Ubuntu how to install and configure JRE

  

JRE is the abbreviation of Java Runtime Environment, is the Java runtime environment, as a Java programmer, to use Java you must first install and configure the Java runtime environment, the following small series will introduce you how to install Ubuntu JRE.

Installation Steps

First download the JRE and open http://www.java.com/en/download/linux_manual.jsp? locale = en (oracle on the website I used to get on the line) can see the following link

Click for download 46.0MB get a link that jre-7u25-linux-i586.tar The .gz tarball is decompressed using the following command:

tar -xzvf jre-7u25-linux-i586.tar.gz

Then get a jre1.7.0_25 directory (the specific version is based on the actual situation) ), as follows:

is then copied to the directory /usr /lib /java directory.

Next you need to use vim or gedit to modify the /etc/environment configuration file. Add the following environment variable to this file:

JAVA_HOME=“/usr/lib/java/jre1 .7.0_25”

CLASSPATH=“$JAVA_HOME/lib”

PATH=“$JAVA_HOME/bin”

After saving, use the following command to further install this Jre

sudo update-alternatives --install /usr/bin/java java /usr/lib/java/jre1.7.0_25/bin/java 300

This installs this jre However, there may be multiple jres in the system. So if the system decides which one to use as the default jre, you need to use the following command:

sudo update-alternatives --config java

jre then prompted to select it, as shown below:

Note: just type java -version command to display the correct configuration successful!

At this point, jre is installed

The above is the Ubuntu installation JRE step, after installing the JRE, remember to use the command to configure the JRE, if you do not know how to configure, However, refer to the method described in this article.

Copyright © Windows knowledge All Rights Reserved