Forums Register Login

could not find the main class

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Could you post the class and how are you calling it?
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
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.
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1343 times.
Similar Threads
getting an error while executing jar file
Trouble running Java program from command line
Jar files
Packaging self-running jar
Java Virtual Machine troubleshooting
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:00:54.