one of my friend has instaled java 7 when we compile a program it compile well but when we run it gives a error
"could not find or load main class Ab.class".
enviromental variable are set
Give the classpath using -cp argument and then try to run it.
Say if your class file is in D:\JavaPrograms folder then run it using java -cp D:\javaPrograms Ab
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 26716
posted
0
Disagree. It is most likely Jesper was correct.
Ankush Kaundal
Greenhorn
Joined: May 12, 2011
Posts: 14
posted
0
Campbell Ritchie wrote:Disagree. It is most likely Jesper was correct.
That what is said by jesper is also right but still the system will not be able to find classpath of the program and then you have to use this argument.