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

What is the method of installing Tomcat switching JDK in CentOS system

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

Share

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

CentOS system installation Tomcat switch JDK method is how, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

I don't know that everyone has had this problem before. After the CentOS system is installed, the default JDK in the CentOS system is OpenJDK. I found that there is a problem with the image of the application CAPTCHA developed by us. I checked that the interface of Image is different from Sun JDK. We generally use Sun JDK in our development under Windows, so we have to replace Sun JDK. Generally, we have to delete OpenJDK. Later, we looked up the problem of the CentOS system on the Internet. A new method has been found to convert the java version using alternatives. The specific methods are as follows:

First, you need to add the newly installed jdk to alternatives:

[root@djn-laptop sbin] # / alternatives-- install / usr/bin/java java / usr/share/jdk1.6.0_02/bin/java 300

[root@djn-laptop sbin] # / alternatives-- install / usr/bin/javac javac / usr/share/jdk1.6.0_02/bin/javac 300

/ usr/share/jdk1.6.0_02/bin/java is the Sun JDK directory we installed, depending on the directory where you installed it.

Then use the-- display option to view the JDK currently available on the CentOS system:

[root@djn-laptop sbin] #. / alternatives-display java

You can then use the-- config parameter to select the JDK you want:

[root@djn-laptop sbin] #. / alternatives-config java

A list of JDK appears after using this command

1/usr/lib/jvm/java-1.4.2-gcj/bin/javac

2/usr/share/jdk1.6.0_02/bin/javac

Press 1 or 2 to select the jdk you want to use. After the switch is completed, use java-version in the CentOS system to view the specific version.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

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