003-linux the JDK installation process

Source: Internet
Author: User

Note: RPM and software-related commands are equivalent to software Assistant management software under Windows

1 See if the current Linux system has Java installed

1) in the command window, you can view the OPENJDK version information that comes with the system.

Java-version

2) You can also view the Java files installed on the Linux system by typing the name on the command line

Rpm-qa | grep java

Name Interpretation: Rpm-qa | grep java

RPM Management Suite

-qa use Inquiry mode to query all packages

Grep finds eligible strings in a file

Java finds files that contain Java strings

2 Uninstall two openjdk installed on the Linux system

1) Enter the command rpm-e--nodeps the software to be uninstalled

The name of the software to uninstall

Noarch files can not be deleted

Command explanation:

RPM Management Suite

-e Delete the specified package

--nodeps does not verify the correlation of the suite files

3 uploading JDK to Linux system is done directly on the Remote connection tool

4 Creating the Java installation directory under Usr/local

5unzip the JDK to/usr/local/java

has been extracted to the specified folder

6 Modifying file names

The original is a bit too long, the name modification is shorter.

7 Configuring Environment variables

1 at the command line type: Vim/etc/profile Enter file---naming mode

Vim/etc/profile

Command Description:

Vim text editing

/etc/profile global variable file

into the text editing state, the cursor goes to the last line of the file, the keyboard press I:-----edit mode--"Edit the file

I

Paste the following content code in:

Note:java_home=/usr/local/java/jdk1.7 This is the installation directory for your JAVA files.

#set Java Environmentjava_home=/usr/local/java/jdk1.7classpath=.: $JAVA _home/lib.tools.jarpath= $JAVA _ Home/bin: $PATHexport java_home CLASSPATH PATH

After pasting in, press ESC to enter the bottom row mode

Input: Then enter Wq write and save

8 Let the environment variable you just set take effect

Type the following command:

Source/etc/profile

9 Verify that the configuration is successful

Here, the JDK under Linux is installed successfully.

003-linux the JDK installation process

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.