Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install jdk 1.6 in CentOS system

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to install jdk 1.6in the CentOS system, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.

System: centos 5.5 (32-bit)

Required software package: jdk-6u32-linux-i586-rpm.bin

1. Download jdk

Go to the official website to download jdk 1.6

Address: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html

two。 Install jdk 1.6

Copy the code

The code is as follows:

Chmod + x jdk-6u32-linux-i586-rpm.bin

. / jdk-6u32-linux-i586-rpm.bin

3. Switch from OpenJDK to Sun JDK

Copy the code

The code is as follows:

Alternatives-install / usr/bin/java java/ usr/java/default/bin/java 1

Alternatives-- install / usr/bin/javac javac / usr/java/default/bin/javac 1

4. Select the desired version

Copy the code

The code is as follows:

Alternatives-config java

5. Set system environment variables

Copy the code

The code is as follows:

Vi / etc/profile

Export JAVA_HOME=/usr/java/default

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

Export PATH=$PATH:$JAVA_HOME/bin

Execute an order to make it effective:

Copy the code

The code is as follows:

Source / etc/profile

6. View the java version:

Copy the code

The code is as follows:

Java-version

On how to install jdk 1.6 in the CentOS system to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report