But I can see the class!

Hello,

Please, help with some explanations for the following error.

Exception in thread "main" java.lang.NoClassDefFoundError:

I am looking at the class even as I type this mail, yet it is invisible to Java. What exactly is going on?

Guys, I am new to this language. I am really confused about a lot of things in Java at the moment. So, please help.

Thanks,

ue-Joe.

[408 byte] By [ue_Joea] at [2007-11-27 4:54:11]
# 1
http://java.sun.com/docs/books/tutorial/getStarted/problems/index.html
YAT_Archivista at 2007-7-12 10:08:47 > top of Java-index,Java Essentials,New To Java...
# 2

Thank you very much for the link. I have got quite useful suggestions form it. However, I am still not able to compile my code. Can you help explain the error message below?

Microsoft Windows XP [Version 5.1.2600]

(C) Copyright 1985-2001 Microsoft Corp.

C:\>cd conversionService

C:\conversionService>dir

Volume in drive C has no label.

Volume Serial Number is F4E5-2352

Directory of C:\conversionService

05/20/2007 01:54 PM<DIR> .

05/20/2007 01:54 PM<DIR> ..

05/20/2007 01:18 PM<DIR> impl

05/20/2007 07:42 PM530 MoneyCalculator.class

05/20/2007 01:18 PM10,802 MoneyCalculator.jar

03/23/2007 02:36 AM582 MoneyCalculator.java

04/27/2007 04:51 PM 5,605 MoneyCalculator.wsdl

05/20/2007 12:17 PM745 MoneyCalculatorImpl.class

05/02/2007 02:14 AM745 MoneyCalculatorImpl.java

05/20/2007 01:56 PM 1,614 MoneyCalculatorTester.class

05/20/2007 01:56 PM 1,519 MoneyCalculatorTester.java

8 File(s) 22,142 bytes

3 Dir(s) 25,392,816,128 bytes free

C:\conversionService>java MoneyCalculatorTester

Exception in thread "main" java.lang.NoClassDefFoundError: MoneyCalculator (wrong name: conversionService/MoneyCalculatorTester)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$000(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

C:\conversionService>java -cp %javapath% MoneyCalculatorTester

Exception in thread "main" java.lang.NoClassDefFoundError: Files\Java\jdk1/6/0_01\bin;

C:\conversionService>

Regards,

ue_Joe.

ue_Joea at 2007-7-12 10:08:47 > top of Java-index,Java Essentials,New To Java...
# 3
have you set your windows path and class path correctly? If not, or if you are not sure, please check out [url= http://www.codeguru.com/forum/showthread.php?s=&threadid=287250]this thread[/url]./Pete
petes1234a at 2007-7-12 10:08:47 > top of Java-index,Java Essentials,New To Java...
# 4
Ah, I see that the link provided by YAT_Archivist has already suggested this. I suggest that the original poster follow through with our similar suggestions. That is the only way that you can resolve this problem. Otherwise java will not be able to find your .class files. /Pete
petes1234a at 2007-7-12 10:08:47 > top of Java-index,Java Essentials,New To Java...