Installing JDK on Linux operating system

Source: Internet
Author: User

Step 1: Download the JDK 1.7 installation package

JDK 1.7:http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

There are two points to note during the download process:

1: note the operating system version, and the 32-bit or 64-bit operating system. As shown below, Linux is divided x86, x64 two kinds,

product/file Description

file Size

download

linux x86

80.38 MB

jdk-7u25-linux-i586.rpm

linux x86

93.12 MB

jdk-7u25-linux-i586.tar.gz

linux x64

81.46 MB

jdk-7u25-linux-x64.rpm

Linux x64

91.85 MB

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


Step 2: Check if there are other versions of the JDK on the Linux system, and if so, uninstall the old version of JKD first.

[Email protected]/]# Java-versionjava version "1.4.2" gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-51) Copyrigh T (C) 2006 free software Foundation, inc.this are free software; See the source for copying conditions. There is nowarranty; Not even to merchantability or FITNESS for A particular PURPOSE.

View information about your own JDK

[Email protected] ~]# Rpm-qa | grep Gcj[jdk][java]libgcj-4.1.2-51.el5java-1.4.2-gcj-compat-1.4.2.0-40jpp.115libgcj-4.1.2-51.el5

Uninstalling the information of your own JDK

[Email protected]/]# rpm-e--nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115


Step 3: unzip the installation JDK

RPM Package Installation

[Email protected] java]# chmod +x jdk-7u25-linux-x64.rpm[[email protected] java]# RPM-IVH Jdk-7u25-linux-x64.rpmpreparing ########################################### [100%]1:jdk ###################### ##################### [100%]unpacking JAR Files...rt.jar...jsse.jar...charsets.jar...tools.jar...localedata.jar ...

Tar Package Installation


Step 4: Configure environment variables

Add under the Etc/profile file

Export Java_home=/usr/java/jdk1.7.0_25export classpath=/usr/java/jdk1.7.0_25/libexport PATH= $JAVA _home/bin: $PATH

If you do not want to re-system, you can use the command source/etc/profile to make the configuration file effective immediately. Otherwise, the system can only be restarted for the configuration parameters to take effect.

[Email protected]]# Source/etc/profile

Verify that the environment variable is in effect

[Email protected] ~]# echo $JAVA _home/usr/java/jdk1.7.0_25[[email protected] ~]# echo $PATH/usr/java/jdk1.7.0_25/bin :/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/x11r6/ Bin:/root/bin[[email protected] ~]# echo Echo $CLASSPATH/usr/java/jdk1.7.0_25/lib[[email protected] ~]#

Step 5: Verify that the installation is successful, and that the environment variables are in effect

[Email protected] tmp]# java-version

Java Version "1.7.0_25"

Java (TM) SE Runtime Environment (build 1.7.0_25-b15)

Java HotSpot (TM) 64-bit Server VM (build 23.25-b01, Mixed mode)

Installing JDK on Linux operating system

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.