Reputation: 443
I'm trying to compile my programs using the command prompt on Windows 7. I'm having a problem when I during compile. I created a test program:
class test
{
public static void main (String args[])
{
System.out.println("this is working!!!!!!");
}
}
I use the following instructions from the command line:
cd \
cd summer
Javac test.java
java test
I have even tried using javaw and I get the same message but in a pop-up box
Could not find the main class, program will exit.
Any suggestions?
Upvotes: 1
Views: 150
Reputation: 26
You are using different versions of JDK. Check the versions on your javac vs java. This error is telling you that your java and compiled class are not same versions. Check your path for configuration, type "set" in dos to see details.
Example: If you compiled your class with javac (version 7) and execute it with java (version 6)
Upvotes: 0