Error: Could not find or load main class (netbeans and java)

前端 未结 3 1061
长情又很酷
长情又很酷 2020-12-20 02:38

I am new to Java, but have some programming experience. I am reading a book on how to program in the Java language. My progress is impeded by my lack of knowledge with NetBe

相关标签:
3条回答
  • 2020-12-20 03:19

    This worked for me (Java 8 on Netbeans, June 2019): File > Project Properties > Run > Application Class > Browse > and try a different application class entry

    0 讨论(0)
  • 2020-12-20 03:26

    I had the same problem and was able to fix it by setting the paths via cmd line:

    cd C:\Program Files\Java\jdk*version*\bin>cd\
    set path="C:\Program Files\Java\jdk*version*";
    set classpath="C:\Program Files\Java\jdk*version*\lib\rt.jar";
    
    0 讨论(0)
  • 2020-12-20 03:34

    Close netbeans and then delete this directory C:\Users\Your name here\AppData\Local\NetBeans\Cache

    Start Netbeans again and let it read the project.

    Test project. Run project. It should work fine.

    0 讨论(0)
提交回复
热议问题