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 configure jdk under Linux

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

Share

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

Editor to share with you how to configure jdk under Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

I have successfully installed jdk (jdk-1_5_0_02-linux-i586.rpm) on Fedora Core 3, and the other versions of Linux are basically the same, the process is as follows:

1. First download jdk (jdk-1_5_0_02-linux-i586.rpm) from the Internet, recommend SUN's official website www.sun.com, download it and put it in the / home directory, of course, other places are fine.

Enter the installation directory

# cd / home

# cp jdk-1_5_0_02-linux-i586.rpm / usr/local

# cd / usr/local

Add executable permissions to all users

# chmod + x jdk-1_5_0_02-linux-i586.rpm.bin

#. / jdk-1_5_0_02-linux-i586.rpm.bin

The file jdk-1_5_0_02-linux-i586.rpm is generated, and executable permissions are also added to all users

# chmod + x jdk-1_5_0_02-linux-i586.rpm

Installation program

# rpm-ivh jdk-1_5_0_02-linux-i586.rpm

If the installation agreement appears, just press accept.

two。 Set the environment variable.

# vi / etc/profile

Join at the end

# set java environment

JAVA_HOME=/usr/java/jdk-1_5_0_02

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

PATH=$JAVA_HOME/bin:$PATH

Export JAVA_HOME CLASSPATH PATH

Save exit.

To make JDK available to all users, you can do this:

Vi / etc/profile.d/java.sh

Enter the following in the new java.sh:

# set java environment

JAVA_HOME=/usr/java/jdk-1_5_0_02

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

PATH=$JAVA_HOME/bin:$PATH

Export JAVA_HOME CLASSPATH PATH

Save exit and assign permissions to java.sh: chmod 755 / etc/profile.d/java.sh

3. Use the echo command at the terminal to check the setting of the environment variable.

# echo $JAVA_HOME

# echo $CLASSPATH

# echo $PATH

4. Check that JDK is installed successfully.

# java-version

If you see the JVM version and related information, the installation is successful!

The above is all the contents of the article "how to configure jdk under Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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