Install JRE in Ubuntu

Source: Internet
Author: User

Today, I encountered many problems when installing Java JRE using the simple installation command of ubuntu, so I finally switched to using an offline package to install JRE.

The procedure is as follows:

First open http://www.java.com/en/download/linux_manual.jsp? Locale = en

The following link is displayed:

Click the 46.0mbit link and download the file to a jre-7u25-linux-i586.tar.gz compressed package. Run the following command to decompress the package:

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

Then we get a jre1.7.0 _ 25 directory, as shown below:

Copy the directory to the/usr/lib/Java directory.

Next, use vim or gedit to modify the/etc/environment configuration file. Add the following environment variables to this file:

Java_home = "/usr/lib/Java/jre1.7.0 _ 25"
Classpath = "$ java_home/lib"
Path = "$ java_home/bin"

Run the following command to install the JRE:

Sudo Update-alternatives -- install/usr/bin/Java/usr/lib/Java/jre1.7.0 _ 25/bin/Java 300

In this way, the JRE is installed. However, there may be multiple jre in the system. to determine which one is used as the default JRE, you need to use the following command for Configuration:

Sudo Update-alternatives -- config Java

Select JRE as prompted, as shown in:

Now, JRE has been installed!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.