Processing error: java/lang/NoClassDefFoundError: java/lang/Object

Source: Internet
Author: User

Processing error: java/lang/NoClassDefFoundError: java/lang/Object operating system environment: CentOS6.0 2.6.32-220. el6.x86 _ 64
JDK version environment: JDK 1.5.0 _ 22 was originally installed with JDK 1.6. Later, developers asked java programs to use JDK. Help developers download JDK1.5,
After JDK is installed, this error occurs after environment variables are set:

  1. [Root @ fztest97 lib] # javac
  2. Error occurred during initialization of VM
  3. Java/lang/NoClassDefFoundError: java/lang/Object
  4. [Root @ fztest97 lib] # java
  5. Error occurred during initialization of VM
  6. Java/lang/NoClassDefFoundError: java/lang/Object

First, check whether the environment variables are set correctly. Secondly, check whether the rt and tools in the lib and jre/lib folders are in the packaged form. If rt is found. pack and tools. most of the problems with pack are here.
The solution is also very simple. You only need to decompress the corresponding file into rt. jar and tools. jar, you can use the unpack200 tool in bin,
For example, convert unpack200 rt. pack rt. jar/apps/usr/java/jdk1.5.0 _ 22/lib/tools. pack to tools. jar.
Convert/apps/usr/java/jdk1.5.0 _ 22/jre/lib/rt. pack to rt. jar and run the following command:
  1. [Root @ fztest97] # cd/apps/usr/java/jdk1.5.0 _ 22/lib/
  2. [Root @ fztest97 lib] # unpack200 tools. pack tools. jar
  3. [Root @ fztest97 lib] # ls
  4. Dt. jar ir. idl jconsole. jar orb. idl sa-jdi.jar tools. jar tools. pack
  5. [Root @ fztest97 lib] # cd/apps/usr/java/jdk1.5.0 _ 22/jre/lib
  6. [Root @ fztest97 lib] # unpack200 rt. pack rt. jar
  7. [Root @ fztest97 lib] # ll rt .*
  8. -Rw-r --. 1 root 40232487 May 23 rt. jar
  9. -Rw-r --. 1 root 12960918 May 23 rt. pack



Run the following command again for verification:
  1. [Root @ fztest97 lib] # java-version
  2. Java version "1.5.0 _ 22"
  3. Java (TM) 2 Runtime Environment, Standard Edition (build 1.5.0 _ 22-b03)
  4. Java HotSpot (TM) 64-Bit Server VM (build 1.5.0 _ 22-b03, mixed mode)

  5. [Root @ fztest97 lib] # javac
  6. Usage: javac <options> <source files>
  7. Where possible options include:
  8. -G Generate all debugging info
  9. -G: none Generate no debugging info
  10. -G: {lines, vars, source} Generate only some debugging info
  11. -Nowarn Generate no warnings
  12. -Verbose Output messages about what the compiler is doing
  13. -Deprecation Output source locations where deprecated APIs are used
  14. -Classpath <path> Specify where to find user class files
  15. -Cp <path> Specify where to find user class files
  16. -Sourcepath <path> Specify where to find input source files
  17. -Bootclasspath <path> Override location of bootstrap class files
  18. -Extdirs <dirs> Override location of installed extensions
  19. -Endorseddirs <dirs> Override location of endorsed standards path
  20. -D <directory> Specify where to place generated class files
  21. -Encoding <encoding> Specify character encoding used by source files
  22. -Source <release> Provide source compatibility with specified release
  23. -Target <release> Generate class files for specific VM version
  24. -Version Version information
  25. -Help Print a synopsis of standard options
  26. -X Print a synopsis of nonstandard options
  27. -J <flag> Pass <flag> directly to the runtime system

So far, JDK1.5 has been installed and configured successfully.
 

This article is from the "vcdog's blog" blog, please be sure to keep this source http://255361.blog.51cto.com/245361/874171

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.