This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
From NetCAT participant: [JDK 1.4.2] I still have problems to get my project running in NB4.0. (1) I set the project's main class using Project Properties --> Running Project --> Main Class --> Browse NB40 finds my main class. I select it and press ok. No problem so far. When I press F6 now, NB tells me that my project does not have a main class and pops up the browsing window again. It finds my main class, I select it again resulting in a fresh browsing window popping up and so on endlessly. (2) Then I tried the following: I typed in a wrong package name for my main class. Then I press F6. In this case NB compiles my project and tries to run it. It stops with: init: deps-jar: Compiling 533 source files to C:\development\wines\simulator\netbeans\simulator\build\classes Note: Some input files use or override a deprecated API. Note: Recompile with -deprecation for details. compile: run: java.lang.NoClassDefFoundError: main/simulation/SimulatorMain Exception in thread "main" Java Result: 1 BUILD SUCCESSFUL (total time: 12 seconds) This looks fine for me, because the class truly does not exist. (3) My question is: Why does NB not start to compile and run my project as above in (2) when I set the main-class correctly but instead complains about not having the main class set at all? Are there any special requirements for the main-class or the main-method in it? NB4.0 finds my main class, but does obviously not accept it. BTW, I do not have any problems with my project in NB3.6.
The project was created with New Project --> Standard --> Java Project with Existing Sources Unfortunately, I can not sent my project over. I'll try to find a reproducible subset.
Don't you have varargs in your main method? Just in case your project would use 1.5 platform. See #47801.
The processing of main classes has been changed after NB4beta (see issue 47481), it works for me. Reopen if any you case doesn't pass and attach it, please.
This problem does not occur anymore with beta2 on my projects.