Install JDK 7 on CentOS and JDK 7 on centos

Source: Internet
Author: User

Install JDK 7 on CentOS and JDK 7 on centos
1. Download jdk

Http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

Select jdk-7u75-linux-x64.rpm

2. Install jdk

Create directoryMkdir/usr/java

Switch to the download directory and copy the downloaded file/Usr/java cp jdk-7u75-linux-x64.rpm/usr/java

Switch to/usr/java to modify permissionsChmod + x jdk-7u75-linux-x64.rpm

RunRpm-ivh jdk-7u75-linux-x64.rpm

3. environment variable configuration

Vi/etc/profile

Add at the end:

# Set java environment

Export JAVA_HOME =/usr/java/jdk1.7.0 _ 75

Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar

Export PATH = $ PATH: $ JAVA_HOME/binexport JAVA_HOME CLASSPATH PATH

Save and exit: X

Enable environment variable Configuration: Source/etc/profile

Establish a connection:

Cd/usr/bin

Ln-s-f/usr/java/jdk1.7.0 _ 75/jre/bin/java

Ln-s-f/usr/java/jdk1.7.0 _ 75/bin/javac

4. Detection

Java-version javac

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