Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NoClassDefFoundError: java/lang/Object

Status
Not open for further replies.

Shrp

IS-IT--Management
Jan 9, 2002
82
0
0
US
I recently unpacked the j2sdk-1_4_2_02-solaris-sparcv9.sh from Sun, and when I run the version of Java there, I get:

% java -version
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

How can I fix this error? Thanks!
 
Every class you want to use in your application should be located either in current directory or been written into CLASSPATH environment variable.

All classes of java runtime environment (i.e. class java.lang.Object) are packed in rt.jar archive in your java installation. Look for it and write path to this package in your CLASSPATH or write it in commandline (-classpath commandline argument).

Good luck/
 
Artemyy :
There is no need to include rt.jar specifically in your CLASSPATH as long as JAVA_HOME is set.
 
After unpacking that file into a directory called /opt/j2sdk1.4.2_02, there is no rt.jar file there. The installation instructions refer to adding several SUNWj3* packages, but I don't see which directory inside the structure to do this from - files with these names don't exist.

I can run 'java -fullversion' rather than 'java -version' and get apparently correct output, but now I'm concerned that something else will bite me down the road.

Thanks!!!
 
rt.jar lives in $JAVA_HOME\jre\lib - but there is no need to reference it directly.

I've never heard of "SUNWj3" ...

If in doubt, uninstall the sdk, and reinstall it, following the docs to the letter, and you should be fine.
 
I unpack the executable and there are no *.jar files. There is very little else in the installation docs. There are references to "SUNWj3*" packages that you (un)install, when you use the tar file. I guess these don't apply.

I unpack into a directory that I link to from /usr/j2se. The installation docs refer to this directory structure:


...and I don't have half of these files.

Where should I download the executable? And are the correct installation docs in:


Thanks!!
 
Hmmm, I see what you mean about the SUNWJ* files.

From the docs ( :


On SPARC processors:
zcat j2sdk-1_4_2_<version>-solaris-sparc.tar.Z | tar -xf -
On x86 processors:
zcat j2sdk-1_4_2_<version>-solaris-i586.tar.Z | tar -xf -

This creates several directories (SUNWj3dmo, SUNWj3dev, SUNWj3man, SUNWj3rt, and SUNWj3jmp) in the current directory.


Doing that step doesn't create the SUNWJ* directories then ?
Are you sure the download isn't corrupt ?
 
All I did with the pkg* commands was remove some of the old SUNWj* packages. I didn't add any (because I couldn't find them), but I'm glad I didn't now, because that has nothing to do with running the unpacking script.

I unpack the j2sdk-1_4_2_02-solaris-sparcv9.sh into a brand new user directory and there are no *.jar files. Maybe it *is* corrupt - the size of the .sh file is 4847937 bytes.

Thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top