Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error message

 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7466
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah.. it worked
But why didn't it worked with the '\' ?
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because of the syntax rules for java packages which require the "."
 
Junilu Lacar
Bartender
Posts: 7466
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic