Install the JRE environment in ubuntu 14.04, 14.04jre

Source: Internet
Author: User

Install the JRE environment in ubuntu 14.04, 14.04jre

It took me one morning to finally install the latest jre. It's not easy. I 've experienced countless failures. I really want to give myself a thumbs up !!!

1. Download the jre installation package

Web http://www.java.com/en/download/manual.jsp

On the above page, find the linux Section

Select linux x64 and download it. Be sure to write the 64-bit version to prepare for installing the java Plug-in firefox later.


2. Install jre

Find the downloaded file and decompress it:

sudo tar -zxvf jre*.tar.gz

Create a JAVA library directory:

mkdir /usr/lib/java

Move the file to a folder:

sudo mv jre* /usr/lib/java/

Modify environment variables:

Many friends like to modify/etc/environment. This is a system-level modification, which is effective for any user. We do not recommend that you directly modify system-level files.

It should be modified according to the process of configuring the user environment in linux ~ /. Profile file. This is the file that the system will automatically execute for you when each user logs in. This will not affect other users. This is important !!!

vim ~/.profile
Add the following content

Export JAVA_HOME = "/usr/lib/java/jre1.7.0 _ 67"
Export CLASSPATH = "$ JAVA_HOME/lib"
Export PATH = "$ JAVA_HOME/bin": $ PATH


Update the configuration file immediately on the terminal:

source ~/.profile
Now the environment variable has changed. How are you doing. Enter the following command to test:

echo $PATH
Isn't there any more java !!!


The most critical step is to enter:

sudo update-alternatives --install /usr/bin/java java /usr/lib/java/jre1.7.0_67/bin/java 300
Check whether the current JAVA environment has been installed:

java -version

3. Allow firefox to support java

A command is enough: (first, go to the/usr/lib/mozilla/plugins/directory !)

sudo cp -a /usr/lib/java/jre*/lib/amd64/libnpjp2.so

4. Check if the load is successful in firefox!

In the firefox address bar, enter:

About: plugins



Success!





Ubuntu1404 install the jre Environment

Sudo apt-get install openjdk-7-jre
Or
Sudo apt-get install openjdk-8-jre
The two commands are only different in java version.
After installation, you do not need to set or restart anything,
Can be used directly ~
 
How to install jre in ubuntu

Command installation:
Sudo apt-get install default-jre or open the Software Center and search for jre for installation.


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.