Linux CentOS 7 under JDK 1.7 installation and configuration

Source: Internet
Author: User

Download


The first is JDK 1.7 64bit & 32bit:

Jdk-7u79-linux-x64.tar.gz (http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz) Jdk-7u79-linux-i586.tar.gz (http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-i586.tar.gz) Check and Uninstall OpenJDK

The first step is to check if the system has its own OPENJDK and the associated installation package, and if so, uninstall it first.

Check command:

Java-versionrpm-qa | grep java

If you find that you have installed OPENJDK and installed packages, then perform the uninstallation in turn first.

Uninstall command:

Rpm-e–nodeps tzdata-java-2012c-1.el6.noarchrpm-e–nodeps java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64

Direct copy of the above command to Xshell error, be careful to note the front of the –nodeps two bars, pay attention to self-modification.


Unzip the installation


After uploading the installation files to the Linux server, go to the directory to perform the decompression installation:

TAR-ZXVF jdk-7u75-linux-x64.tar.gz

After the decompression is complete, create a new Java directory and move the JDK directory you just unzipped to the directory we created:

MKDIR/WOCLOUD/JAVAMV./jdk1.7.0_75/wocloud/java/

Finally, delete the installation files:

RM-RF jdk-7u75-linux-x64.gz

Configuring Environment variables


After the installation is complete, you need to configure the environment variables and edit the/etc/profile file:

Vi/etc/profile Add the following configuration at the end of the file: Export java_home=/wocloud/java/jdk1.7.0_75 export classpath=.: $JAVA _home/jre/lib/rt.jar : $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar export path= $PATH: $JAVA _home/bin

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/9C/65/wKioL1lwEV2DQI1sAABmTLYP_tg333.jpg-wh_500x0-wm_ 3-wmp_4-s_2537900149.jpg "title=" 1.jpg "alt=" Wkiol1lwev2dqi1saabmtlyp_tg333.jpg-wh_50 "/>

After editing, remember to enter: Wq save exit, the last step is to reload the/etc/profile file via the source command, so that the modified content is valid in the current shell window:

Source/etc/profile

Test


Enter Java-version to view the JDK version information:

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/9C/65/wKiom1lwEbbgVncDAAARG1Kz6-0444.png-wh_500x0-wm_ 3-wmp_4-s_457131563.png "title=" 6ly1rjbtas~ (]3sgkhgu55p.png "alt=" Wkiom1lwebbgvncdaaarg1kz6-0444.png-wh_50 "/>

Linux CentOS 7 under JDK 1.7 installation and configuration

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.