There is no time to record tomcat finished a few days ago and it is relatively idle today. So let's make a brief summary and report an error to tomcat startup:
Error occurred during initialization of VM
Java/lang/NoClassDefFoundError: java/lang/Object
Make a summary. You can check the problem later to help you better understand it. You also hope to provide a solution for those who encounter the same error.
1. Download jdk and tomcat
Http://download.chinaunix.net/down.php? Id = 33932 & ResourceID = 61 & site = 1
Http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.tar.gz
2. Install the jdk Environment
[Root @ localhost src] # ls
Apache-tomcat-6.0.36.tar.gz debug jdk-6u26-dlj-linux-amd64.bin kernels
[Root @ localhost src] # chmod o + x jdk-6u26-dlj-linux-amd64.bin // Add the execution permission x to the jdk's other user, some versions will prompt for the next action after performing this step. There is no prompt for this version. We will perform the Next Step manually.
[Root @ localhost src] #./jdk-6u26-dlj-linux-amd64.bin // there will be a large heap prompt information after execution, the following will prompt you whether to execute the same:
Do you agree to the above license terms? [Yes or no]
Run yes.
After completion, a new directory is generated in the current directory: jdk1.6.0 _ 26
[Root @ localhost src] # ls
Apache-tomcat-6.0.36.tar.gz jdk1.6.0 _ 26 kernels
Debug jdk-6u26-dlj-linux-amd64.bin
[Root @ localhost src] # mkdir-p/usr/java // create a directory to build the jdk Environment
[Root @ localhost src] # mv jdk1.6.0 _ 26/usr/java/[root @ localhost src] # vim/etc/profile // modify environment variables, add the following content to the file:
Export JAVA_HOME =/usr/java/jdk1.6.0 _ 26
Export CLASSPATH = $ CLASSPATH: $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib
Export PATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATH: $ HOMR/bin
Source/etc/profile // make the environment variable take effect immediately
Java-version // check the java version to check whether the jdk is successfully installed.
3. install and configure tomcat
[Root @ localhost src] # tar zxvf apache-tomcat-6.0.36.tar.gz
[Root @ localhost src] # mv apache-tomcat-6.0.36/usr/local/tomcat_1
[Root @ localhost src] # cd/usr/local/tomcat_1/
[Root @ localhost tomcat_1] # ls
Bin lib logs RELEASE-NOTES temp work
Conf license notice RUNNING.txt webapps
[Root @ localhost tomcat_1] #./bin/startup. sh // start tomcat
Using CATALINA_BASE:/usr/local/tomcat_1
Using CATALINA_HOME:/usr/local/tomcat_1
Using CATALINA_TMPDIR:/usr/local/tomcat_1/temp
Using JRE_HOME:/usr/java/jdk1.6.0 _ 26
Using CLASSPATH:/usr/local/tomcat_1/bin/bootstrap. jar
[Root @ localhost tomcat_1] # java // execute the java command
Error occurred during initialization of VM
Java/lang/NoClassDefFoundError: java/lang/Object // error. It seems that a vm error occurs during initialization.
[Root @ localhost tomcat_1] # ps-ef | grep java | grep-v grep // NO content is displayed after execution, no process [root @ localhost tomcat_1] # netstat-nutpl | grep 8080 // check whether tomcat port 8080 is started. If no content is displayed, port 8080 is not started, that is to say, tomcat is not started. Think twice !! [Root @ localhost tomcat_1] # cat. /logs/catalina. out // view tomcat's logs Log File Error occurred during initialization of VMjava/lang/NoClassDefFoundError: java/lang/Object after google, with high guidance, the result is: 4. solution Error: Error occurred during initialization of VMjava/lang/NoClassDefFoundError: java/lang/Object
[Root @ localhost tomcat_1] # cd/usr/java/jdk1.6.0 _ 26/lib/
[Root @ localhost lib] # ls
Ct. sym htmlconverter. jar jconsole. jar orb. idl tools. pack
Dt. jar ir. idl jexec sa-jdi.jar visualvm
[Root @ localhost lib] # unpack200 tools. pack tools. jar // convert the file type
[Root @ localhost lib] # cd/usr/java/jdk1.6.0 _ 26/jre/lib/
[Root @ localhost lib] # ls
Rt. pack // find the file under the Directory and run the following command: [root @ localhost lib] # unpack200 rt. pack rt. jar [root @ localhost lib] # javaUsage: java [-options] class [args...] (to execute a class) or java [-options]-jar jarfile [args...] (to execute a jar file )........... // there is still a lot of content later. It is not posted here and can be executed by java commands.
[Root @ localhost lib] #/usr/local/tomcat_1/bin/startup. sh // start tomcat again
Using CATALINA_BASE:/usr/local/tomcat_1
Using CATALINA_HOME:/usr/local/tomcat_1
Using CATALINA_TMPDIR:/usr/local/tomcat_1/temp
Using JRE_HOME:/usr/java/jdk1.6.0 _ 26
Using CLASSPATH:/usr/local/tomcat_1/bin/bootstrap. jar
[Root @ localhost lib] # netstat-ntl // check whether port 8080 of tomcat is enabled
Active Internet connections (only servers)
Tcp 0 0: 8080: * LISTEN tcp 0: 22: * LISTEN tcp 0: 1: 631 ::: * LISTEN tcp 0 0: 1: 25: * LISTEN tcp 0 0: 55001: * LISTEN tcp 0: ffff: 127.0.0.1: 8005 ::: * LISTEN tcp 0 0: 8009: * LIS
OK. Our port 8080 is up.
[Root @ localhost lib] # ps-ef | grep java | grep-v grep // check whether a java Process exists.
Root 11454 1 0 09:31 pts/0 00:00:08/usr/java/jdk1.6.0 _ 26/bin/java-Djava. util. logging. config. file =/usr/local/tomcat_1/conf/logging. properties-Djava. util. logging. manager = org. apache. juli. classLoaderLogManager-Djava. endorsed. dirs =/usr/local/tomcat_1/endorsed-classpath/usr/local/tomcat_1/bin/bootstrap. jar-Dcatalina. base =/usr/local/tomcat_1-Dcatalina. home =/usr/local/tomcat_1-Djava. io. tmpdir =/usr/local/tomcat_1/temp org. apache. catalina. startup. bootstrap start
OK, the process also exists. Next we will check in the browser for access:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/1150044316-0.png "border =" 0 "alt =" "/>
OK. Our apache fault has been resolved and can be accessed.
If you can see it, it is also a compliment to me. Thank you for your attention.
This article is from the "Mu zi" blog, please be sure to keep this source http://lifenlun163.blog.51cto.com/5159500/1130133