Created attachment 92234[details]
screen shot showing that the file MudLogViewerApp is not runnable
I am unable to "run file" on a file (MudLogViewerApp.java) that does have a valid main method. The "run file" menu options are greyed out, and in the project window, the file is lacking the icon badge denoting that it has a main method.
I've attached a screen shot that shows the state of NetBeans when I saw this problem. Just previously to this I had done a cvs update, and then a "clean build". You can see the build status completed without any errors in the lower right window.
I have about 150 java files that are supposed to be runnable, I cannot create seperate run configurations for each. I depend on being able to use the "run file" feature a lot.
I was using NetBeans 6.8 RC 1 when I saw this issue.
works fine with latest 6.8 build on Linux, Mac OS, WinXP using Java Applcation
slreynolds, what kind of project do you use?
it is very strange that Run Project menu item disabled. it should be enabled for all java projects.
moreover, Run File menu enabled even for java classes without main method
I have a plain Java SE project (a Swing desktop application). In NB terms it is a "Java Project with Existing Sources".
The pop up menu from the edit tab area showed the same behavior.
This behavior appears to be intermittent -- when I restart NB, I cannot reproduce this problem anymore.
The source root for the file in question is
The NB project is at
I'm not using any symbolic links. The project has other source roots which are
Sorry, I guess that my immediately previous attachment and comment is wrong in an important way. The file I was trying to run today, Composite.java, is in a project that is a NetBeans module. Trying to "run file" in a NetBeans module probably doesn't make any sense, and NetBeans is preventing me from doing something stupid (oops too late).
Please ignore my immediately previous attachment and comment from 2009-12-09 12:10:24.
Created attachment 92393[details]
screen shot of re-occurrence with LasParserExample
re-occurrence of the problem (no really this time).
After this re-occurrence, I exited NB and then restarted it. I was then able to run the file.
I am not able to reproduce, seems to work fine in dev.
I've added logging into the dev build. If you can reproduce it with dev build please run it with
-J-Dorg.netbeans.modules.java.api.common.project.BaseActionProvider.level=FINE command line option and attach the log.
Comment 10Quality Engineering
2011-04-07 08:46:39 UTC
I downloaded NB dev 201104070400. I do not see this problem now; I think it has been a long time since I've seen it.
I've enabled the logging option that you requested, and if I can reproduce this issue, I'll upload the generated log file.
For me this works with the project types
Java Application and
Java Class Library
But if I
1) create a Platform Application,
2) add a module to it,
4) add a Java class to that module and
4) insert a main method (using code template psvm)
i can not run that file. Not via the menubar or the contextmenu.
Changing the package the java class is in to public in the modules API versioning does not change this behavior.
I'll attach the messages.log file shortly.
Created attachment 107685[details]
messages.log of unsuccessfull attempt to run file
in that file i tried to run a class from within an Module, Java Application and Java Classfile project.
Java Application and Java Classfile projects with success.
Module Project without success.
I had the same condition in NetBeans 8.0 with a stand-alone project. Couldn't run no matter what, even though I ran it tons of times in the past.
After restarting NetBeans, I could run again like normal. So I guess this really is a (rather unproduceable) bug.
Just to add I encountered the bug just now in Netbeans 8.0. Came here, restarted Netbeans and it worked fine. Not a clue how it happened.
Netbeans had been open for a few days. I had created a project with multiple classes in the same folder to make a simple binary tree, then created a new project with a single class with multiple functions outside of the Main and tried to run and couldn't. I could only run the previous program using shift+F11. Any new projects wouldn't run either.
I can't seem to reproduce it.
I tried running the tree file again then running the last one, bug didn't happen.
I tried running the tree file then building a new program identical to the one I had open when the bug happened and the bug didn't happen.
I'm sorry I can't think how else to try.
Don't know if this can help something, but I have had the same problem, and it has persisted even restarting NB 8.0...
I've solved it just changing the project folder name in Windows explorer (this has been enough for me)...
It isn't the first time it happened to me.
Hope this help to find the problem.
I use NetBeans 8.0 every day and about every 3rd day I run into this bug. I can overcome it by terminating NetBeans and starting it again (sometimes I have to repeat more than once). I have no idea what causes this bug but it happens again and again.