• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

could not find the main class

 
kumar kushagra
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i am running a .jar file it is showing that "could not find the main class : program will exit" . but the same .jar file is running in other system .can you tell what is the problem with my system.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the class and how are you calling it?
 
kumar kushagra
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hebert Coelho wrote:Could you post the class and how are you calling it?

i have a java application which my friend has send me so i am just trying to run that program on my system so i don't know which class he has used.
 
Rob Spoor
Sheriff
Pie
Posts: 20545
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ignore that message; the program that runs JAR files when you double click it, javaw, has terrible error handling and shows the same error message for any throwable that's being thrown by the main method. Open a command prompt, go to the folder where the JAR file is located, and use java instead: This will show the stack trace of the actual throwable. My guess is that it will be a NoClassDefFoundError, which would indicate you're missing a few JAR files on the class path.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic