Could not find or load main class

后端 未结 16 1254
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 20:27

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:

16条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-27 20:40

    javac should know where to search for classes. Try this:

    javac -cp . p1.java
    

    You shouldn't need to specify classpath. Are you sure the file p1.java exists?

提交回复
热议问题