The first step: first install the Linux system on the VM, here does not introduce how to install Linux system, will not go to Baidu. But here's a reminder of how the virtual machine and the native are going to transfer data, and I'm using the [Virtual machine sharing file option].
Installation method: Virtual machine menu Vm-instal VMware Tools and installed. If you are installing JDK and Tomcat under a real Linux system, you can ignore this step.
Set up shared folders
Step two: Download JDK and Tomcat
- Download jdk-8u111-linux-x64.rpm
Jdk:http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Download apache-tomcat-8.5.9.tar.gz
: http://tomcat.apache.org/download-80.cgi
After success, put jdk-8u111-linux-x64.rpm and apache-tomcat-8.5.9.tar.gz under the F:\VM shared folder.
Step three: Install JDK and Tomcat
- To run the Linux system, be aware that you need to enter it with the root user.
- The file under directory/mnt/hgfs file is the same as the host "F:\vm shared Files" file, if there is a difference, it is your computer running too slow, has not reacted. You can complete the installation by double-clicking the/mnt/hgfs/aaa/jdk-8u111-linux-x64.rpm file.
- At the command line, enter:
Vi/etc/profile
Add the following, as shown in
Export java_home=/usr/java/jdk1.8.0_111
Export Java_bin=/usr/java/jdk1.8.0_111/bin
Export path= $PATH: $JAVA _home/bin
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export Java_home java_bin PATH CLASSPATH
4. Enter the/usr/bin/directory
Cd/usr/bin
Ln-s-f/usr/java/jdk1.8.0_111/jre/bin/java
Ln-s-f/usr/java/jdk1.8.0_111/bin/javac
Java–version
Screen output:
Java Version "jdk1.8.0_111"
Java (TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot (TM) 64-bit Server VM (build 25.111-b14, Mixed mode)
To indicate that the installation was successful or the installation failed.
- Command Line Input:
#tar-ZXVF apache-tomcat-8.5.9.tar.gz//Decompression
#cp-R apache-tomcat-8.5.9/usr/local/tomcat//copy apache-tomcat-5.5.29 to/usr/local/and renamed Tomcat
/usr/local/tomcat/bin/startup.sh//Start Tomcat
Screen output:
Using catalina_base:/usr/local/tomcat
Using Catalina_home:/usr/local/tomcat
Using Catalina_temdir:/usr/local/tomcat/temp
Using Java_home:/usr/java/jdk1.6.0_20
To this tomcat has been installed, now using the browser to access http://localhost:8080, the Tomcat default page appears, indicating that the installation was successful. As shown in the following:
Configuring JDK and Tomcat under Linux