One, JDK installation
Steps to install the JDK (install using the root user login to avoid the need for file authorization)
(1) Download JDK,JDK storage directory is generally stored in the/OPT directory (Oracle website download JDK, need to accept license, using the following command can be directly authenticated by the user)
wget--no-check-certificate--no-cookies--header "Cookie:oraclelicense=accept-securebackup-cookie"/HTTP/ Download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
CP jdk-8u144-linux-x64.tar.gz/opt/
(2) Unzip the JDK
TAR-XZVF jdk-8u144-linux-x64.tar.gz
PWD--/opt/jdk1.8.0_144
(3) Setting the JDK environment variable
Export Java_home= "/opt/jdk1.8.0_144"
Export path= "$JAVA _home/bin: $PATH"
(4) Refresh the configuration for the configuration to take effect
source/opt/jdk1.8.0_144
(5) Write demo verification
Touch Demo.java
Vim Demo.java
public class demo{public static void Main (string[] args) { System.out.println ("Hello World"); } }
Javac Demo.java See if Demo.class is generated
Java demo to see if the output is printed, there is a successful installation
II. TOMCAT Installation
(1) Download and unzip the Tomcat GZ file
wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-8/v8.5.20/bin/apache-tomcat-8.5.20.tar.gz
TAR-XZVF apache-tomcat-8.5.20.tar.gz
(2) Go to Tomcat's Bin directory to execute startup.sh, log on after successful launch localhost:8080 see if the Tomcat interface is up and finished
Note: Java editing tools such as Eclipse can be installed on similar steps to develop Java programs in Linux.
Linux Installation Java Development environment