Could not find the main class?
I am getting a
Could not find the main class. Program will exit!
Error with 1.3, but its because there is a jar file missing from the class path. The main class is actually there. Took me 1/2 to figure that out. This must be an error in the java command. Anyone else notice this?
[306 byte] By [
dnoyeB] at [2007-9-26 3:00:39]

I forgot an example:
class MyClass() {
public MyClass {
System.out.println("Hello");
}
public static void main(String[] args) [
MyClass myClass = new MyClass();
System.exit(0);
}
}
Compile it with: javac MyClass.java
Start it with: java MyClass
hoffy4 at 2007-6-29 10:57:58 >

The class is fine. Everything is fine as I said. There was just a jar file which was referenced in the manifest which was missing. So instead of sayng there was a missing jar file, or cant find so-and-so class, java says it cant find the "main class" Which was not true at all.
I set the -verbose tag, and got java to tell the truth on the command line, but java still send a popup window saying main class is missing, which it is not.
dnoyeB at 2007-6-29 10:57:58 >

Hello all,
Im having same difficulties. (Its really driving me mad).
I have number of classes in a jar file.
The jar command is like this:
jar cmfv META-INF\manifest.mf forrit.jar *.class (I am in the directory where the classes are when I issue this commmand)
My manifest file is simply: Main-Class: torfan.TorfaClass
Now after the jar procedure and I try to execute this jar file I get this error?
I have been looking everywhere for a solution but nothing yet.
Any ideas?
Hi all
I'm stuck in the same thing as well...not only am I having problem with the JAR file I created, I'm also having problem executing other's JAR files..
For example, I created this JAR file with 'Main-Class: PrototypeTest' as it's header but when the JAR file is done and I tried to run it, it simply gives me the No Main Class Found error.
Same thing happens when I downloaded this JAR file game from Virum's website and tries to run it...no can do either...
So wondering...has anyone found the solution to this yet? I'm still looking but it is sure driving me crazy...
Hi all...
Managed to solve the 'No Main-Class' Error for my case.
Apparently, there's this thing about reading the manifest file correctly. The last line of the manifest file should be a space but NOT a carriage return. I removed the carriage return at the end of my manifest file and it runs fine now.
Hope this help! :)