PDA

View Full Version : Java: JVM Error: Could not find the main class. Program will exit


tatacalu
15 Jun 2007, 07:40am
Hello!

I downloaded a small Java source project. I used Eclipse SDK 3.2.2 to build it, and exported it as a .JAR file. when I used the command:

javaw xxx.jar to run it, the Java Virtual Machine throwed me the following error message:

Could not find the main class. Program will exit.

When Eclipse asked me what was the project's main class,
Select the class of the application entry point:
, I selected the class that contained

public static void main(String[] args) { ... }

, but still, the JVM told me that the main class was not found.
Could anybody tell me wheather I did something wrong ?

Thanks!

tatacalu
16 Jun 2007, 01:40am
dudes.. no one ???

shwaip
16 Jun 2007, 07:02pm
open up the rar file with a compression program that supports .rar. (winrar, for example). Find the manifest file, and make sure that the mainclass attribute is set properly.

lightnin
25 Jun 2007, 02:45pm
sounds like a common classpath error. make sure the current working directory is set in your classpath.

d4rkst4r
12 Jul 2007, 03:53pm
make sure you named the file the same name in the public class