Installation of jdk1.7 RPM packages under Linux

Source: Internet
Author: User

1. Download and install jdk7.0 for Linux

The version I downloaded is: jdk-7u2-linux-i586.rpm

is: http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u2-download-1377129.html

2, upload the jdk-7u2-linux-i586.rpm to the user directory

3, [[email protected] ~]RPM-IVH jdk-7u2-linux-i586.rpm

Preparing ... ########################################### [100%]
1:JDK ########################################### [100%]
Unpacking JAR files ...
Rt.jar ...
Jsse.jar ...
Charsets.jar ...
Tools.jar ...
Localedata.jar ...
Plugin.jar ...
Javaws.jar ...
Deploy.jar ...
[Email protected] ~]#

4. Configure environment variables by modifying the/etc/profile file to see the JDK installation directory in Linux first
[Email protected] ~]# ls/usr/java/
Default JDK1.7.0_02 Latest
The visible directory is/usr/java/jdk1.7.0_02, and the value of Java_home is this value.

Add the following to the end of the file:
Export java_home=/usr/java/jdk1.7.0_02
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tool.jar

After Setup is complete, exit, or use the Source/etc/profile mission to make the settings effective.

Annotations:
A./usr/java/jdk1.7.0_02 is the JDK installation directory
B. Use the colon ":" to separate the paths under Linux
C. $PATH/$CLASSPATH/$JAVA _home is used to refer to the value of the original environment variable, especially when setting the environment variable to be careful not to overwrite the original value.
D. Current directory in Classpath "." Cannot be lost.
E. Export is exporting these three variables as global variables.
F. The case must be strictly differentiated.

5, test success or not.
[Email protected] java]# java-version
Java Version "1.7.0_02"
Java (TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot (TM) Client VMs (build 22.0-B10, mixed mode, sharing)
[Email protected] java]#

Description succeeded.

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.