1. Install Java (assuming installation folder bit/usr/local here)
1) Download the JDK (jdk-7), for example:
32-bit: http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-i586.tar.gz
64-bit: http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz
Download command (take 64 bits for example):
$ cd/usr/local$ sudo wget http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz
2) Unzip to the installation folder. Use such as the following command:
$ cd/usr/local$ sudo tar-xf jdk-7u67-linux-x64.tar.gz
3) Configure the environment variables, change the/etc/profile file
$ sudo vim/etc/profile
Add, for example, the following at the end:
Export java_home=/usr/lib/jdk1.7.0_67 export JRE_HOME=/USR/LIB/JDK1.7.0_67/JRE export classpath=.: $JAVA _ Home/lib: $JRE _home/lib: $CLASSPATH export path= $JAVA _home/bin: $JRE _home/bin: $PATH
Run such as the following command:
$ source/etc/profile
Enter the Java command to see if it takes effect, and some of the results are as follows:
$ Javausage:java [-options] class [args ...] (to execute a class) Or Java [-options]-jar jarfile [args ...] (To execute a JAR file) where options include: -d32 with 32-bit data model if available -d64 use a 64-bit Data model if available -server to Select the "Server" VM, the default VM is server. -CP <class Search Path of directories and Zip/jar files>-classpath <class Search Path of directories and Zi P/jar files> a:separated List of directories, jar archives, and ZIP archives to search for class FILES.
-d<name>=<value>
2. Install Maven
1) Download, download commands such as the following:
$ cd/usr/local$ sudo wget http://apache.fayea.com/apache-mirror/maven/maven-3/3.2.2/binaries/ Apache-maven-3.2.2-bin.tar.gz
2) Unzip, commands such as the following:
$ cd/usr/local$ sudo tar-xf apache-maven-3.2.2-bin.tar.gz
3) Configure Environment variables
$ sudo vim/etc/profile
Add, for example, the following at the end:
Export M2_home=/usr/local/apache-maven-3.2.2export path= $PATH: $M 2_home/bin
Run such as the following command:
$ source/etc/profile
Enter the MVN--help command to see if it takes effect, and some of the results are as follows:
MVN--helpusage:mvn [Options] [<goal (s);] [<phase (s) >]options:-am,--also-make If Project list is Specified, also build projects required by the list-amd,--also-make-dependents If Project list is specified , also build projects that depend on projects on the List-b,--batch-mode Run in non-interactive (batch) m Ode-c,--strict-checksums Fail The build if checksums don ' t match
3. Install Tomcat
1) Download
$ cd/usr/local$ sudo wget http://mirrors.cnnic.cn/apache/tomcat/tomcat-7/v7.0.55/bin/apache-tomcat-7.0.55.tar.gz
2) Unzip
$ cd/usr/local$ sudo tar-xf apache-tomcat-7.0.55.tar.gz
3) Configure Environment variables
$ sudo vim/etc/profile
Add, for example, the following at the end:
Export Export Tomcat_home=/export/software/apache-tomcat-7.0.42export path= $PATH: $TOMCAT _home/bin
Run such as the following command:
$ cd/usr/local/apache-tomcat-7.0.55$ bin/startup.shusing catalina_base: /usr/local/apache-tomcat-7.0.55using Catalina_home: /usr/local/apache-tomcat-7.0.55using catalina_tmpdir:/usr/local/apache-tomcat-7.0.55/ Tempusing jre_home: /usr/local/jdk1.7.0_67/jreusing CLASSPATH: /usr/local/apache-tomcat-7.0.55/bin/ Bootstrap.jar:/export/software/apache-tomcat-7.0.55/bin/tomcat-juli.jartomcat started.
At this point, when the browser opens http://localhost:8080, you can see such as the following page, indicating that the startup was successful.
The ability to run such as the following command turns off Tomcat:
$ cd/usr/local/apache-tomcat-7.0.55$ bin/shutdown.shusing catalina_base: /usr/local/apache-tomcat-7.0.55using Catalina_home: /usr/local/apache-tomcat-7.0.55using catalina_tmpdir:/usr/local/apache-tomcat-7.0.55/ Tempusing jre_home: /usr/local/jdk1.7.0_67/jreusing CLASSPATH: /usr/local/apache-tomcat-7.0.55/bin/ Bootstrap.jar:/export/software/apache-tomcat-7.0.55/bin/tomcat-juli.jar
Reprint Please specify Source:http://blog.csdn.net/iAm333
Installation of Java, Maven, Tomcat under Linux