java.lang.NoClassDefFoundError [message #90916] |
Thu, 06 December 2001 14:21 |
Paul
Messages: 164 Registered: April 1999
|
Senior Member |
|
|
Hi>
When trying to compile with java.c a .class file there where no troubles but when trying to run in with java the .java the message:
java.lang.NoClassDefFoundError
is shown in the promt
I know is a silly question but I 'm starting with this java thing
Thanks
----------------------------------------------------------------------
|
|
|
Re: java.lang.NoClassDefFoundError [message #90932 is a reply to message #90916] |
Wed, 12 December 2001 05:32 |
Jason Ladd
Messages: 7 Registered: December 2001
|
Junior Member |
|
|
Can you re-phrase your question, it doesn't make a whole lot of sense. You'll also need to include the actual commands you are attempting.
----------------------------------------------------------------------
|
|
|
|
|
|
java.lang.NoClassDefFoundError [message #91156 is a reply to message #90916] |
Sat, 11 May 2002 23:23 |
Jess Datta
Messages: 1 Registered: May 2002
|
Junior Member |
|
|
Hello -
I'm having the following issue:
I am able to compile my java code with the javac command, but when I appempt to run it I get the java.lang.NoClassDefFoundError. I read other posts regarding this issue.
I have '.' in my classpath.
The directory that my class file is in is included in my classpath.
The file I'm trying to compile is a sample code for the JavaMail api. I've included the mail.jar file in my classpath and put it in my ext directory.
The actual error message I'm getting is:
C:j2sdk1.4.0JavaMailjavamail-1.2demo>java msgsend
Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Message
Any other ideas?
Thanx!!
|
|
|
Re: java.lang.NoClassDefFoundError [message #91230 is a reply to message #91156] |
Wed, 05 June 2002 23:11 |
M.R.Alam
Messages: 1 Registered: June 2002
|
Junior Member |
|
|
My Class Path is
set classpath=C:homeralamxerces-1_4_4xerces.jar;C:homeralamExaXmljava_xml_pack-spring-02-devjaxp-1.2-ea2dom.jar;C:homeralamExaXmljava_xml_pack-spring-02-devjaxp-1.2-ea2sax.jar;C:homeralamxerces-1_4_4xercesSamples.jar
C:homeralamxerces-1_4_4samplesui>java TreeView
Exception in thread "main" java.lang.NoClassDefFoundError: TreeView
|
|
|
Re: java.lang.NoClassDefFoundError [message #91500 is a reply to message #90916] |
Thu, 10 October 2002 22:10 |
kr4z33
Messages: 1 Registered: October 2002
|
Junior Member |
|
|
hi... i found this by searching for the error when I got it. compiling my 2nd java proggie :) anyway, to fix it: instead of typing "java [[programname.class]]" just type "java [[programname]]" it should then work. (substituding your actual program for [[programname]] of course....)
|
|
|
Re: java.lang.NoClassDefFoundError [message #91524 is a reply to message #91500] |
Wed, 16 October 2002 17:30 |
Keylee
Messages: 1 Registered: October 2002
|
Junior Member |
|
|
hi... i found this by searching for the error when I got it. compiling my 2nd java proggie :) anyway, to fix it: instead of typing "java [[programname.class]]" just type "java [[programname]]" it should then work. (substituding your actual program for [[programname]] of course....) ~posted by kr4z33
this is a solution, but you should do this anyway. There are other possibilities, one of which I am trying to figure out now...
|
|
|
|
|
Re: java.lang.NoClassDefFoundError [message #91703 is a reply to message #90916] |
Mon, 13 January 2003 17:12 |
Qingyu Wang
Messages: 1 Registered: January 2003
|
Junior Member |
|
|
Control panel => System => Advanced => Environment variables:
Find or create the "CLASS PATH" variable, enter all the paths of your .jar files. The hints:
1. Variable name: CLASS PATH. There should be a space between CLASS and PATH.
2. If you have more than one path, seperate them with ; and leave no space between them.
3. At the end of the last one, use a ; and then a . to finish the setting.
It will work.
|
|
|
Re: java.lang. [message #91750 is a reply to message #90916] |
Mon, 03 February 2003 00:24 |
Ravi
Messages: 251 Registered: June 1998
|
Senior Member |
|
|
Just now I have installed jdk1.4.0 (C:J2SDK_Fortejdk1.4.0jre) and when I run a sample program I am getting NoClassDefFoundError:
Here is my CLASSPATH value (I have tried all)
;C:ravi;C:J2SDK_Fortejdk1.4.0jrebin;C:J2SDK_Fortejdk1.4.0jrelib;C:ProgramFilesJavaj2re1.4.0bin;C:ProgramFilesJavaj2re1.4.0lib
Please HELP!!
|
|
|
|
that worked [message #92001 is a reply to message #91500] |
Wed, 21 January 2004 05:27 |
nd
Messages: 5 Registered: January 2004
|
Junior Member |
|
|
Thanks that worked :P
I got to the program directory, and typed
# java [[program name without .class]]
and that worked for me (but I did set that CLASS PATH env. variable)
|
|
|