Home » Developer & Programmer » JDeveloper, Java & XML » java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError [message #90916] Thu, 06 December 2001 14:21 Go to next message
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 Go to previous messageGo to next message
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.

----------------------------------------------------------------------
Re: java.lang.NoClassDefFoundError [message #90980 is a reply to message #90916] Sun, 27 January 2002 03:50 Go to previous messageGo to next message
jws
Messages: 1
Registered: January 2002
Junior Member
you need to add the directory of your new class file to your classpath
Re: java.lang.NoClassDefFoundError [message #90987 is a reply to message #90916] Tue, 29 January 2002 20:46 Go to previous messageGo to next message
Vijay
Messages: 116
Registered: September 1999
Senior Member
You need to include . in your classpath.
Re: java.lang.NoClassDefFoundError [message #91001 is a reply to message #90916] Mon, 04 February 2002 13:24 Go to previous messageGo to next message
oswaldo gonzalez lopez
Messages: 1
Registered: February 2002
Junior Member
Estoy montando el cliente java sobre linux mandrake una aplicacion hecha en informix D4gl para poder verla en Internet y no he podido superar este error java.lang.NoClassDefFoundError

gracias oswaldo
java.lang.NoClassDefFoundError [message #91156 is a reply to message #90916] Sat, 11 May 2002 23:23 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 #91542 is a reply to message #90916] Tue, 29 October 2002 09:42 Go to previous messageGo to next message
Thanyani Tyron
Messages: 1
Registered: October 2002
Junior Member
SET YOUR CLASSPATH CORRECTLY!
Re: java.lang.NoClassDefFoundError [message #91679 is a reply to message #90916] Wed, 08 January 2003 20:00 Go to previous messageGo to next message
amorer
Messages: 1
Registered: January 2003
Junior Member
now, I got the same question!when i connect mysql with jdbc,it gives me the prompt,but the java class without jdbc work well!
Re: java.lang.NoClassDefFoundError [message #91703 is a reply to message #90916] Mon, 13 January 2003 17:12 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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!!
Re: java.lang. [message #91810 is a reply to message #90916] Fri, 28 February 2003 14:29 Go to previous messageGo to next message
Somebody with the same pr
Messages: 1
Registered: February 2003
Junior Member
I had the same problem. I switched to C#. At least it works ....
that worked [message #92001 is a reply to message #91500] Wed, 21 January 2004 05:27 Go to previous message
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)
Previous Topic: Passing character into Java Stored Procedures
Next Topic: using xmltype with xml
Goto Forum:
  


Current Time: Thu Apr 18 02:01:41 CDT 2024