Apache Tomcat is a Servlet/JSP container and version 8.0 implements the Servlet 3.1 and JavaServer Pages 2.3 specifications. Please note that Apache Tomcat 8.0 requires a Java Standard Edition Runtime Environment (JRE) version 7 or later. So we start with installing a recent version of Oracle’s JRE.
Install Oracle JRE 8 on Debian Linux (or Raspbian)This is installed with Java SE Development Kit 8 Update 60. The file has been seen being downloaded from java-runtime-environment.tr.softonic.com and multiple other hosts. Java version “1.8.060” Java(TM) SE Runtime Environment (build 1.8.060-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode).
To install Oracle’s Java Runtime with apt-get, we first need to entend the list of apt-get’s sources. Once that is done, an java-installer will actually install the Java SE Runtime Environment. Here are the steps to follow:
As I’m writing this, the newly installed Java Runtime reports its version as 1.8.0_101:
- FULL PRODUCT VERSION: java version '1.8.031' Java(TM) SE Runtime Environment (build 1.8.031-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode) ADDITIONAL OS VERSION INFORMATION: Microsoft Windows Version 6.1.7601 A DESCRIPTION OF THE PROBLEM: We are launching our application via Java Web Start.
- Go to Oracle's Java SE 8 Archive Downloads page and locate the desired version of Java. Example: If you want to install Java 8 Update 60, find the box labeled Java SE Runtime Environment 8u60. If you have questions about which version of Java to install, please contact the Technology Service Desk. In the gray box, select Accept License Agreement.
- $ java -version java version '1.8.060' Java (TM) SE Runtime Environment (build 1.8.060-b27) Java HotSpot (TM) 64-Bit Server VM (build 25.60-b23, mixed mode) $ javac -version javac 1.8.060 以上 参考.
With Java now installed we move on, installing Tomcat. However, it may be beneficial to have an dedicated user for Tomcat.
BTW, Java got installed into this location: /usr/lib/jvm/java-8-oracle
.. which should result in something like this:
Installing Tomcat 8.5.xTo make it easy to replace this release with future releases, we are going to create a symbolic link that we are going to use when referring to Tomcat (after removing the old link, you might have from installing a previous version):
Since we created a tomcat user, he should also own all these files in
If Tomcat’s default HTTP port (8080) is already in use, you need to edit the server.xml configuration file, e.g.
edit /usr/share/tomcat/conf/server.xml and replace 8080 with 8000
To start Tomcat automatically, every time the server re-boots, save this script in /etc/init.d/tomcat
Now change the permissions of the newly created file and add the correct symlinks automatically:
JAVA_OPTS='-Djava.security.egd=file:/dev/urandom'
at the beginning of the bin/catalina.sh file, will significatinly speedup the startup time.While not my preferred Linux distribution, RedHat and CentOS are the standard in Corporate America. So here are a few comments on how to install Java and Tomcat on RedHat:
Installing Java 8This will install Oracle’s Java 8 or more specifically Java(TM) SE Runtime Environment (build 1.8.0_51-b16) and Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode) here: /usr/java/jdk1.8.0_51/
Later, if you decide to run Tomcat on port 80, you will also need to execute this:
Since we created a tomcat user, he should also own all these files in
If Tomcat’s default HTTP port (8080) is already in use, you need to edit the server.xml configuration file, e.g.
edit /usr/share/tomcat/conf/server.xml and replace 8080 with 8000
To start Tomcat automatically, every time the server re-boots, save this script in /etc/init.d/tomcat
Now change the permissions of the newly created file and add the correct symlinks automatically:
JAVA_OPTS='-Djava.security.egd=file:/dev/urandom'
at the beginning of the bin/catalina.sh file, will significatinly speedup the startup time.While not my preferred Linux distribution, RedHat and CentOS are the standard in Corporate America. So here are a few comments on how to install Java and Tomcat on RedHat:
Installing Java 8This will install Oracle’s Java 8 or more specifically Java(TM) SE Runtime Environment (build 1.8.0_51-b16) and Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode) here: /usr/java/jdk1.8.0_51/
Later, if you decide to run Tomcat on port 80, you will also need to execute this:
and cat this content
into /etc/ld.so.conf.d/java.conf
Creating a Tomcat User accountuseradd -r -m tomcat
passwd -l tomcat
/etc/systemd/system/tomcat.service
- sudo systemctl daemon-reload
- sudo systemctl enable tomcat
- sudo systemctl start tomcat
This page describes options for installing, configuring, and creating a log file for the Windows Java Runtime Environment.
This page contains the following topics:
See 'JDK 8 and JRE 8 Installation Start Here' for general information about installing JDK 8 and JRE 8.
IntroductionThis page describes options for installation of the Java SE Runtime Environment (JRE) on Windows 32-bit platform. It is intended for:
System administrators deploying the JRE with Java Plug-in and Java Web Start technologies on multiple PCs in their Intranet without user interaction.
Vendors having products requiring the JRE. The JRE can be silently (non-interactively from the command line) installed with their product.
JRE installers are built using Microsoft Window Installer (MSI) 2.0 technology. MSI contains built-in support for silent installations. This topic explains how to manually install the JRE using the .exe
file that runs the MSI.
This section describes the command-line options for the JRE Windows Offline Installer. Run the installer as follows:
jre
refers to the JRE Windows Offline Installer base file name (for example,jre-8u05-windows-i586.exe
).INSTALLCFG=
configuration_file_path
specifies the path of the installer configuration file. See 'Installing With a Configuration File' for more information.options
are options with specified values separated by spaces. Use the same options as listed in Table 20-1, 'Configuration File Options'. In addition, you may use the option/s
for the JRE Windows Offline Installer to perform a silent installation.
If you perform a static installation of the JRE (by specifying the command-line or configuration file option STATIC=1
), then the Java Auto Update feature will leave that JRE installed during a Java update. A later version of the same JRE family will be installed in a separate directory. This mode ensures that vendors, who require a specific version of the JRE for their product, can be certain that the JRE will not be overwritten by a newer version.
The default installation directory of a static JRE is C:Program Files (x86)Javajre
n
(for 32-bit versions) or C:Program FilesJavajre
n
(for 64-bit versions), where n
is the full Java SE release and update number (for example, n
= 1.8.0_20 for release 8 update 20).
Use a log file to verify that an installation succeeded. To create a log file describing the installation, append /L C:
path
setup.log
to the install command and scroll to the end of the log file to verify.
The following is an example of creating a log file:
Java Se Runtime Environment 8u201This example causes the log to be written to the path
setup.log
file.