Build Java JDK Environment under Linux

Source: Internet
Author: User
Tags gz file

First, download

First of all, of course it is to download.


Select a different version as needed.

Second, decompression

Unzip the downloaded. tar.gz file.

Use the following command to extract:

Tar zxvf./jdk-7u45-linux-x64. tar.gz

For ease of administration, you can move the extracted files to another folder.

You can do it without doing it.

The author moved the file to the/opt/java/jdk/directory.

To facilitate the next set of environment variables, change the folder to a short name--jdk1.7

You can rename a folder by using the following command

MV Jdk1. 7.0_45/jdk1. 7/ 

Third, set environment variables

Edit the. bashrc file.

Enter the following command at the terminal:


At the end of the file, add the following lines of code:

Export Jre_home=${java_home}/jreexport classpath=.:${java_home}/lib:${jre_home}/libexport PATH=${JAVA_HOME}/ Bin: $PATH

In order for the changes to take effect immediately, execute the following command at the terminal:


PS: When modifying ~/.BASHRC's path modification error, unable to use the system's other commands, the terminal input is as follows: you can use

Export Path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/x11:/usr/games

P.S. It is best to back up the backup command before modifying the. bashrc file:

CP. BASHRC. Bash_origina

Build Java JDK Environment under Linux

Related Article

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: 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.