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 and tomcat in linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article introduces the relevant knowledge of "how to install jdk and tomcat in linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First, install jdk

1. Yum installation. I installed the jdk1.8 version.

The default installation path for jdk is / usr/lib/jvm/

2. Configure environment variables

Open this file and add the following configuration (note the version of jdk):

Export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64

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

Export PATH=$PATH:$JAVA_HOME/bin

Replace the marked green one with your own jdk version! The rest of it is the same!

Save and exit

3. Make the environment variable effective source / etc/profile

4. Check whether java-version is installed successfully

Installation successful!

Second, install tomcat

1. Install tomcat online. I am the mkdir tomcat file installed in the / usr/local/ path. Install tomcat in this folder.

Execute the installation command, install online: wget http://apache.01link.hk/tomcat/tomcat-7/v7.0.94/bin/apache-tomcat-

7.0.94.tar.gz

2. Decompress tar-zxvf apache-tomcat-7.0.94.tar.gz (replace the green part with your own version)

3. After decompression, the directory structure of tomcat is as follows:

4. Go to the bin directory and execute the script. / start.sh to start tomcat

5. The default port number of tomcat is 8080. Check whether the port number starts successfully.

Netstat-tln

Tomcat started successfully!

Close tomcat and cut to the bin directory and execute. / shutdown.sh

Note:

If port 8080 is not started after netstat-tln execution, the port number may be disabled.

Modify the port number:

Vi / etc/sysconfig/iptables

Restart:

Service iptables restart

Done!

That's all for "how linux installs jdk and tomcat". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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

Internet Technology

Wechat

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

12
Report