Error “main class not found”

后端 未结 3 1807
终归单人心
终归单人心 2021-01-22 23:11

All,

My classpath has been set to the following folder:

CLASSPATH = .;C:\\Program Files\\Java\\jdk1.6.0_21\\bin;C:\\Program Files\\Java\\jdk1.6.0_21\\bin         


        
3条回答
  •  隐瞒了意图╮
    2021-01-22 23:46

    You're inside the package. You should be sitting in the package root. Go one folder up.

    cd ..
    

    Then reexecute it using java project.DriverClass.


    That said, you should prefer not to use the CLASSPATH environment variable. Yours is currently also invalid. There are spaces in unquoted pathnames. Also, the JDK/bin folder isn't supposed to go in the classpath. Just use the -cp argument like java -cp . project.DriverClass (while sitting in the package root folder).

提交回复
热议问题