I. Installation and configuration of the JDK
1. Download the JDK file
Go to the official website to download Linux 64-bit jdk-8u131-linux-x64.tar.gz
2. Upload to/usr/local using the FTP tool.
Use the command: TAR-ZXVF jdk-8u131-linux-x64.tar.gz for decompression
3. Configuring environment Variables (/etc/profile)
Using the command: Vim/etc/profile, place the following three lines at the end of the file
Export java_home=/usr/local/jdk1.8.0_131
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $JAVA _home/bin: $PATH
4. Make the environment variable effective immediately
Use command: Source/etc/profile or. /etc/profile
JDK installation and configuration is complete, try to configure the success.
Use commands: Java-version and javac to see if they are normal.
Second, the installation and configuration of Tomcat
1. Download Tomcat
Apache-tomcat-8.0.44.tar.gz
2. Upload to/usr/local using the FTP tool.
Use the command: TAR-ZXVF apache-tomcat-8.0.44.tar.gz for decompression
3. Start Tomcat
Use command:/usr/local/apache-tomcat-8.0.44/bin/startup.sh
4. Visit: http://ip:8080
If you cannot access it, it is because the Linux firewall prohibits access to port 8080
Using the command: Service iptables stop, the CENTOS7 system will prompt the following error message.
This is because CentOS starts with the 7 default is FIREWALLD, this is based on iptables, although there is iptables core,
But Iptables's service is not installed. So you just stop FIREWALLD service:
Execute: sudo systemctl stop firewalld.service && sudo systemctl disable firewalld.service can be
viewing the Tomcat process : Ps-ef |grep Tomcat
Force shutdown process: kill-9 4401
Linux common commands-jdk and tomcat