Installation of jdk in linux and configuration of Environment Variables

Source: Internet
Author: User

Installation of jdk in linux and configuration of Environment Variables

Jdk-7u71-linux-i586.tar.gz

Jdk-7u75-linux-x64.tar.gz

1. Upload a package

2. view the installer

Rpm-qa | grep-I jdk

3. Delete the specified jdk

Rpm e java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.i686

Rpm e java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.i686

4. Check whether the installer is deleted again.

Rpm-qa | grep-I jdk

5. Enter the jdk directory to decompress the package.

Tar-xvf jdk-7u71-linux-i586.tar.gz

6. Create a directory for storing jdk

Mkdir-p/usr/local/jdk

7. Move the decompressed jdk to the newly created directory.

Mv jdk1.7.0 _ 71 // usr/local/jdk/

8. Go to the/usr/local/jdk/jdk1.7.0 _ 75/directory.

Cd/usr/local/jdk/jdk1.7.0 _ 75/bin

9. test whether the jdk is successfully executed.

./Java-version

10. Enable System Environment Configuration

Vim/etc/profile

Open/etc/profile in a text editor

Add the following content to the end of the profile file:

Export JAVA_HOME =/usr/share/jdk1.6.0 _ 14

Export PATH = $ JAVA_HOME/bin: $ PATH

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

12. recompilation takes effect

Source/etc/profile

/Usr/local/jdk/jdk1.7.0 _ 75/

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.