Tuesday, 4 October 2016

java - Could not find or load main class

I have Windows 7, installed jdk1.7.0 and its supporting jre7.
My problem is compilation part works perfectly, but while running the Java program I get this error saying:





"Could not find or load main class"




I am storing all my programs in javalab folder. I have set the path to it. Procedure looks like this:




C:\Users\user>cd\

C:\>cd javalab


C:\javalab>autoexec.bat

C:\javalab>set path=C:\Program Files\Java\jdk1.7.0\bin

C:\javalab>javac p1.java

C:\javalab>java p1
Error: Could not find or load main class p1


C:\javalab>

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...