Step 1 of Installation for linux jdk + tomcat. check whether JDK is installed java login to the system with the root user, open a terminal input # rpm-qa | grep gcj display content contains the following information # java-1.4.2-gcj-compat-1.4.2.0-40jpp.112 # java-1.4.2-gcj-compat-devel-l.4.2.0-40jpp.112 (this package is not pre-installed) uninstall www.2cto.com # rpm-e java-1.4.2-gcj-compat-devel-l.4.2.0-40jpp.112 # rpm-e java-1.4.2-gcj-compat-l.4.2.0-40jpp.112 if there is a dependency, do not let uninstall, it uses rpm-e -- nodeps uninstall on the line of the download jdk-6u22-linux-x64-rpm.bin (ORACLE official website can be found) 2. add executable permissions to files [Root @ esprit java] # chmod + x jdk-6u22-linux-x64-rpm.bin3. run the jdk-6u22-linux-x64-rpm.bin [root @ esprit java] #. /The jdk-6u22-linux-x64-rpm.bin is generated after execution, there are other packages such as sun-javadb 4. install jdk-6u22-linux-x64-rpm [root @ esprit java] # rpm-ivh jdk-6u22-linux-x64-rpm here I jdk installed in/usr/java directory www.2cto.com 5. you can configure environment variables in three ways: Modify the/etc/profile file and modify the environment variables in the user directory. bashrc file, which can be directly modified in shell) Here I will only talk about the modification of the/etc/profile file [root @ Esprit java] # after opening the file vi/etc/profile, add the following to export path user logname mail hostname histsize inputrc: export JAVA_HOME =/usr/java/jdk1.5.0 _ 22 export PATH = $ PATH: $ JAVA_HOME/bin: $ JAVA_HOME/jre/binexport CLASSPATH =.: $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib: # JDK1.5 20120719JAVA_HOME =/usr/java/jdk1.5.0 _ 22JRE_HOME =/usr/java/jdk1.5.0 _ 22/jrePATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATH: $ HOMR/binCLASSPATH = $ CLASSPATH: $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib Press esc and enter: wq to save and exit. Make the configuration take effect source/etc/profile6. write a simple HelloWorld to test the configuration Environment [root @ esprit java] # vi HelloWorld. in the java file, enter: public class HelloWorld {public static void main (String args []) {System. out. println ("Hello World in Linux !! ") ;}}: Wq save and exit [root @ esprit java] # javac HelloWorld. there is no error in java. Next, [root @ esprit java] # output in java HelloWorld shell: Hello World in Linux !! 7. tomcat installation: 1)download installation package apache-tomcat-6.0.32.tar.gz 2) unzip tar zxvf apache-tomcat-6.0.32.tar.gz 3) cp-R apache-tomcat-5.5.28/data/tomcat copy apache-tomcat-6.0.32 to/usr/local, and rename it to tomcat 4) start tomcat: Java code/usr/local/tomcat/bin/startup. if sh displays Using CATALINA_BASE:/opt/java/tomcat Using CATALINA_HOME:/opt/java/tomcat Using CATALINA_TMPDIR:/opt/java/tomcat/temp Using JAVA_HOME: /opt/java/jdk1.6.0 _ 26 8. get package, Ftp server, get ZPY. war and ETL. war are deployed under webapps to start tomcat. Deployed successfully. 9. tomcat optimization: JAVA_OPTS = '-server-Xms1024m-Xmx2048m-XX: PermSize = 128 M-XX: MaxPermSize = 256m' JAVA _ OPTS ='-server-Xms1024m-Xmx2048m-XX: permSize = 128 M-XX: MaxPermSize = 256M 'server. xml optimization maxThreads = "1000"