No main class found #7405
DMAyuquina
started this conversation in
General
Replies: 2 comments
-
My guess is that you renamed or moved the class file which had the main method while the ant project has still the old location configured. you can change it in the project properties. If you create a new project and hit play it should work out of the box. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I notice, that you use NB21 with JDK22. There are known issues of NB21 on JDK22. Please either wait for NB22, which is currently being released or use NB21 with JDK21. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Apache NetBeans version
Apache NetBeans 21
What happened
I tried to create a project in Netbeans for my university, but for some reason the program does not detect a main class in the project. As much as I tried to fix the problem and try to manually configure the main class, I could not do anything because Netbeans does not detect any Java file that I create. Even if I tart directly from the project properties.
Language / Project Type / NetBeans Component
Java/Study Project/Java main class
How to reproduce
Create a new project normally with Java Ant. When the Java class was generated, although it compiles correctly, when running it, the program does not detect any main class.
Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows 11
JDK
22
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
I installed it recently and it does not work the right way. According to the instructions I followed I did not move anything that can affect its operation and still the error is persistent. I uninstalled it and reinstalled it but it didn't work either.
Are you willing to submit a pull request?
Yes
Beta Was this translation helpful? Give feedback.
All reactions