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 JDK8.0 and tomcat-8.5.15

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

Share

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

This article is to share with you about how to install JDK8.0 and tomcat-8.5.15, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Foreword:

JDK (Java Development Kit) is Sun Microsystems's product for Java developers. Since the launch of Java, JDK has become the most widely used Java SDK. JDK is the core of the entire Java, including the Java runtime environment, Java tools and Java basic class libraries. Therefore, in order to run jsp programs must have the support of JDK, of course, the premise of installing Tomcat is to install JDK.

1. JDK installation

1. View os version

[root@mysql] # uname-a

Linux mysql 2.6.32-200.13.1.el5uek # 1 SMP Wed Jul 27 21:02:33 EDT 2011 x86 "64 GNU/Linux

Explanation: if there is x86x64, it is 64-bit, and if not, it is 32-bit. Followed by x686 or x86164, the kernel is 64-bit, and i686 or i386 is 32-bit.

two。 Download the installation package

Download JDK at http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html,

3. Install Java JDK8.0

Then mv the downloaded JDK installation package to the local folder

[root@mysql ~] # mv jdk-8u131-linux-x64.tar.gz / usr/local/

3.2.Jump under local:

[root@mysql ~] # cd / usr/local/

[root@mysql local] # ll jdk-8u131-linux-x64.tar.gz

-rw-r--r-- 1 root root 185540433 Jun 17 17:08 jdk-8u131-linux-x64.tar.gz

3.3.Redecompress the JDK

[root@mysql local] # tar zxvf jdk-8u131-linux-x64.tar.gz

4. Configure environment variables

Add Java-related environment variables to the / etc/profile file and copy the following to the bottom:

JAVA_HOME=/usr/local/jdk1.8.0_131

PATH=$JAVA_HOME/bin:$PATH

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

Export PATH JAVA_HOME CLASSPATH

Note: according to the above configuration information, we can complete the configuration of environment variables, it should be noted that when configuring PATH, we must put JAVA_HOME/bin first, otherwise, when using the java command, the system will find the previous java and stop looking down, so that the directory where the executable file runs is not actually under $JAVA_HOME/bin, but in other directories, it will cause great problems.

4.2. Effective immediately

[root@mysql local] # source / etc/profile

5. Verify that the installation is successful

[root@mysql local] # java-version

Java version "1.8.0,131"

Java (TM) SE Runtime Environment (build 1.8.0_131-b11)

Java HotSpot (TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Add:

If you want to control the permissions of the java environment variable to the user level, you only need to modify the .bashrc file in the home directory of its individual users.

Such as:

Open the .bashrc file in the user directory with a text editor

At the end of the .bashrc file, add:

Set JAVA_HOME=/usr/share/jdk1.5.0_05

Export JAVA_HOME

Set PATH=$JAVA_HOME/bin:$PATH

Export PATH

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

Export CLASSPATH

Log in again

-

Uninstall Java JDK

Note: after executing the java-version command, if the word openjdk displays the result, you need to uninstall openjdk; or sometimes the installation fails or you want to install a new version of JDK, you can uninstall JDK first:

A. First, execute the command to check the version of JDK under the server: the command is as follows: rpm-qa | grep jdk

B, then execute the command: yum-y remove java java-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64 delete each version queried above in turn

Second, install apache-tomcat-8.5.15

Foreword:

Tomcat server is a free and open source Web application server, which is a lightweight application server. It is widely used in small and medium-sized systems and not many concurrent access users. It is the first choice for developing and debugging JSP programs. For a beginner, it can be thought that when an Apache server is configured on a machine, it can be used to respond to requests for access to HTML pages. The Tomcat part is actually an extension of the Apache server, but it runs independently, so when you run tomcat, it actually runs as a separate process from Apache.

1. Jdk version requirements for installing apache-tomcat-8.5.15 version

Tomcat 8.5 requires Java SE 7 or later.

Read the RELEASE-NOTES and the RUNNING.txt file in the distribution for more details.

2. Os to view the JDK version

[root@mysql ~] # java-version

Java version "1.8.0,131"

Java (TM) SE Runtime Environment (build 1.8.0_131-b11)

Java HotSpot (TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

3. Install apache-tomcat-8.5.15

3.0.The download URL of apache-tomcat-8.5.15 is http://tomcat.apache.org/download-80.cgi

Then mv the downloaded apache-tomcat-8.5.15 installation package to the / usr/local/tomcat/ folder

[root@mysql ~] # mkdir / usr/local/tomcat/

[root@mysql ~] # mv apache-tomcat-8.5.15.tar.gz / usr/local/tomcat/

3.2.Jump under local:

[root@mysql ~] # cd / usr/local/tomcat/

[root@mysql tomcat] # ll apache-tomcat-8.5.15.tar.gz

-rw-r--r-- 1 root root 9393241 Jun 17 19:18 apache-tomcat-8.5.15.tar.gz

3.3.Redecompress the apache-tomcat-8.5.15

[root@mysql tomcat] # tar-zxvf apache-tomcat-8.5.15.tar.gz

3.4.Placement of catalina.sh under / etc/init.d/ to prepare for tomcat startup

[root@mysql tomcat] # cp-p / usr/local/tomcat/apache-tomcat-8.5.15/bin/catalina.sh / etc/init.d/tomcat

3.5Editing / etc/init.d/tomcat

Vim / etc/init.d/tomcat

Add the following to the second line:

# chkconfig: 112 63 37

# description: tomcat server init script

# Source Function Library

. / etc/init.d/functions

JAVA_HOME=/usr/local/jdk1.8.0_131/

CATALINA_HOME=/usr/local/tomcat/apache-tomcat-8.5.15

4. Modify permissions and create directories

[root@mysql tomcat] # chmod 755 / etc/init.d/tomcat

[root@mysql tomcat] # chkconfig-- add tomcat

[root@mysql tomcat] # chkconfig tomcat on

5. Start and shut down tomcat

-- start

[root@mysql tomcat] # service tomcat start

Using CATALINA_BASE: / usr/local/tomcat/apache-tomcat-8.5.15

Using CATALINA_HOME: / usr/local/tomcat/apache-tomcat-8.5.15

Using CATALINA_TMPDIR: / usr/local/tomcat/apache-tomcat-8.5.15/temp

Using JRE_HOME: / usr/local/jdk1.8.0_131/

Using CLASSPATH: / usr/local/tomcat/apache-tomcat-8.5.15/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-8.5.15/bin/tomcat-juli.jar

Tomcat started.

Enter http://10.219.24.21:8080/ in the browser to access tomcat

-- close

[root@mysql tomcat] # service tomcat stop

Using CATALINA_BASE: / usr/local/tomcat/apache-tomcat-8.5.15

Using CATALINA_HOME: / usr/local/tomcat/apache-tomcat-8.5.15

Using CATALINA_TMPDIR: / usr/local/tomcat/apache-tomcat-8.5.15/temp

Using JRE_HOME: / usr/local/jdk1.8.0_131/

Using CLASSPATH: / usr/local/tomcat/apache-tomcat-8.5.15/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-8.5.15/bin/tomcat-juli.jar

The above is how to install JDK8.0 and tomcat-8.5.15, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please 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