I've been writing code for about a month and have run into this problem a couple times but seemed to have found a way around it until now.
All of a sudden, any project I compile gives me
java.lang.ClassNotFoundException: gameinterface.Main errors.
The build is successful, but when I try to run the program from NetBeans, I get the following error:
I think I resolved this in the past by making a new project and copy/pasting the code. I know this is not the correct way to resolve the problem though.
Caused by: java.lang.ClassNotFoundException: gameinterface.Main
at java.security.AccessController.doPrivileged(Native Method)
Could not find the main class: gameinterface.Main. Program will exit.
Exception in thread "main" Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
I researched this problem a lot and it seems it has something to do with the CLASSPATH. I can't even find where to change the classpath in NetBeans though.
I tried using the HELP function in NetBeans which suggests:
To declare the classpath for a project:
1) Build the project so that all of the project's build outputs (JAR files and WAR files) exist on your computer.
2) In the Projects window, right-click the project node and choose Properties.
3) Click Classpath in the right panel of the Project Properties dialog box.
The Project Properties - GameInterface window comes up, but there is no mention of Classpath anywhere.
What am I doing wrong?