aspose file tools*
The moose likes Beginning Java and the fly likes error message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "error message" Watch "error message" New topic
Author

error message

rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
I am getting the following error when I try to run my .class file. Can anyone help me why am I getting this?
C:\fleet\modified fleet>java com\trilogy\ford\europe\fleet\client\ECupidSOAPClientImpl
Exception in thread "main" java.lang.NoClassDefFoundError: com\trilogy\ford\europe\fleet\client\ECupidSOAPClientImpl (wrong name: com/trilogy/ford/europe/fleet/client/ECupidSOAPClientImpl)
at java.lang.ClassLoader.defineClass0(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$1(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)


Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
I may be doing something stupid but I really can't figure out.
I tried to simplify my code in order to know the reason still I am getting the same error.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4714
    
    7

Try
C:\fleet\modified fleet>java com.trilogy.ford.europe.fleet.client.ECupidSOAPClientImpl
(use "." instead of "\", Java likes that a lot better)


[This message has been edited by JUNILU LACAR (edited June 15, 2001).]


Junilu - [How to Ask Questions] [How to Answer Questions]
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
yeah.. it worked
But why didn't it worked with the '\' ?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Because of the syntax rules for java packages which require the "."


"JavaRanch, where the deer and the Certified play" - David O'Meara
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4714
    
    7

Originally posted by parmeet bedi:
> But why didn't it worked with the '\' ?
I don't know the exact reason behind it but that's just the way the JVM expects you to identify the class you are trying to run in it. You have to remember, "java" is the program you are running and the rest are command line parameters.
Also, "." follows the Java package identifier format and is more platform-independent than "\". You obviously are running under DOS but in Unix it is "/", in some other platform it could be something else. Using "." makes it uniform across all platforms.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error message