Could not find or load Java Swing core class

Error: could not find or load the main class jeweleryerpapplication.GUI.ERPMainMenu Java Result: 1

In fact, I use Net Beans 7.1 in that I constantly get the same error, but I canโ€™t get a solution for this even after installing the latest update for this. The solution I received from some authority that creates a new project and copies the source and library files in this project from the previous one that generate the above error. This solution works for me, but I need a simpler solution to this problem. Do not forget in advance. Remember to give it up if that helps.

+7
source share
3 answers

I think the following happens:

  • If this is a third-party application, you have not included some jar files in your class path;

  • Or, (which, in my opinion, is most likely), you do not have a method that has this signature: public static void main(String[] args) . This method determines the main entry point for your application, without having an error while trying to start a project. As far as I know, Netbeans automatically creates a main class with this method whenever you create a new project. This may be the reason that you do not have this exception when you create a new project and throw everything at it.

  • You may have a problem with Netbeans. You can start by checking the flow of this previous SO thread, which discussed a similar (I think) problem, or, as a target, you might want to remove Netbeans and all its files and install an earlier version. You can also try and see if you have the same problem if you are using another IDE, such as Eclipse.

+4
source

Right-click on the project node, go to "Configure", select the main class for your application. Then clean and build.

Even if this does not solve your problem, delete the Netbeans cache by deleting the folder (index)

 User\.netbeans\6.9\var\cache\index\ 
+6
source

this solution, right-click your package in netbeans, go to properties, source now go to jre option and select your version, the program will now work.

0
source

All Articles