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.
Product Version = NetBeans IDE Dev (Build 201402140001) Operating System = Linux version 2.6.32-431.5.1.el6.i686 running on i386 Java; VM; Vendor = 1.8.0-ea Runtime = Java HotSpot(TM) Client VM 25.0-b63 Run File menu is disabled eventhough main() method is available in a class. After I observer this, If i restart the nb ide, the button becomes enabled. Both the screenshots are attached
Created attachment 145524 [details] IDE log
Created attachment 145525 [details] screenshot showing runfile toolbar button is disabled eventhough the class contans main() method
Created attachment 145526 [details] screenshot showing runfile toolbar button is enabled after nb restart
Are you sure that "TATA-OTNMS" package node in the Favorites view didn't have focus? In such a case the "Run File" button should be really disabled.
I am very sure that I clicked the editor and saw that the run file button is disabled. Also, it is evident from the screenshot that the background color of the editor tab title is white. It is the behavior of the GTK L&F that currently focussed tab's background is white. I confirmed this again now with netbeans IDE.
I also experienced this after upgrading from 7.4 to 8. Both Run File (Shift-F6) and Compile File (F9) were grayed out in the Run menu. After a restart, they both were working again. Product Version: NetBeans IDE 8.0 (Build 201403101706) Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b70 Runtime: Java(TM) SE Runtime Environment 1.8.0-b132 System: Linux version 3.2.0-4-amd64 running on amd64; UTF-8; en_US (nb)
Created attachment 146026 [details] file without main method shows ability to run file-level commands
Created attachment 146027 [details] file with main method not able to run file level commands
I have had this problem with a few more details. I've attached two more screenshots showing the issues. Not only does the runnable file not allow file level commands such as build, run, or debug but also the non-runnable file shows that it can run or debug. Of course when trying to actually do so on the non-runnable file it fails (as expected). Restarting NetBeans and my computer did not resolve this issue. The only way I can run files is to set them as the main class for my project. Product Version: NetBeans IDE 8.0 RC1 (Build 201402242200) Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b70 Runtime: Java(TM) SE Runtime Environment 1.8.0-b132 System: Windows 8 version 6.2 running on amd64; Cp1252; en_US (nb)
This problem showed up for me in a JFrame form with a main method. I'm using build 201403101706.
wan't able to reproduce with current build 20140722 - neither on a simple java file, nor a jframe form will add some logging, once that is available in a daily build, please try to reproduce and attach your messages.log to the issue.
Is there some information I can provide in the current build to assist in debugging?
more logging core-main #3f4cabdc8d05 to enabled the loggin run NetBeans with -J-Dorg.netbeans.modules.project.ui.actions.FileAction.level=400
> Is there some information I can provide in the current build to assist in debugging? a message should be generated into this issue once the commit above made it into daily builds. Run then NB with the mentioned switch, reproduce and attach messages.log thanks
Integrated into 'main-silver', will be available in build *201407230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/3f4cabdc8d05 User: Tomas Stupka <tstupka@netbeans.org> Log: issue #242261 - Run File menu is disabled eventhough main() method is available in a class added logging
*** Bug 178257 has been marked as a duplicate of this bug. ***
I applied the above fix to the current version of netbeans by integrating the compiled FileAction class & anonymous classes (taken from nightly-201408160001) into the org-netbeans-modules-projectui.jar of the current version. This should have worked & for the most part it seems that if the menu option was active it stayed that way whereas before it might become deactivated (grayed out) after some action was taken e.g. a "clean and compile". But... Today as I launched netbeans for the first time after booting up, and checked the menu option as it performed a background scan it was grayed out and stayed that way?? Any thoughts? Is there also some other issue that needs to be addressed?
> I applied the above fix to the current version of netbeans ... it wasn't a fix, just added some logging to the involved code please reproduce in netbeans and then attach your messages.log file to the issue thanks
I experience this problem daily under 8.0.1. I have a Project Group with 18 projects that I regularly work in. Under 8.0.1, at least 50% of the time, one or more of them (not always the same ones!) will fail to enable the run/debug/etc buttons. The only fix is to restart NB. Close/Open the project makes no difference. As per the suggestion here, I installed the nightly dev build a few days ago and added the debug log settings. And of course the problem won't reproduce. (OS Ubuntu Linux, 1.7.0_51 OpenJDK). I tried to compare activated plugins between the 8.0.1 and dev setups, but there were many that would not install under the nightly build. The C++ plugin and at least 1 other one, had this error: "The plugin Common Test Runner API is requested in version >= 1.26 (release version 1) but only 2.1 (of release version different from 1) was found." While that's probably not related to the root cause of this problem, I mention it just in case. Are there any other debug logs that we can activate to help diagnose this under 8.0.1?
I have this issue at least 2 times a week and restarting the IDE fixes it. It would be great to have this addressed/taken care somehow. My details. Product Version: NetBeans IDE 8.0.2 (Build 201411181905) Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 1 Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
*** Bug 250378 has been marked as a duplicate of this bug. ***
*** Bug 247527 has been marked as a duplicate of this bug. ***
*** Bug 251268 has been marked as a duplicate of this bug. ***
*** Bug 247706 has been marked as a duplicate of this bug. ***
*** Bug 254102 has been marked as a duplicate of this bug. ***
NB 8.0.2 running on desktop Windows 10 64bit, JDK 1.8.0_60, with a java application in development now for 5 years. I ran into this problem, after a power failure, with NB up and all files saved and the application runing. After I restarted the desktop and restarted NB 8.0.2 I could not get the run button to darken for a Java application project. I quit and restarted NB 8.0.2: no help. I changed contents of a file in NB saved and restarted: no help. The files for my projected are in a Google Drive folder, so that this is shared between 2 machines. After I quite NB, I selected the documentation.txt file in src, and edited it slightly using wordpad, saved the edited file, exit wordpad, start NB 8.0.2 now I have the run button available. I have done this twice.
I have hit the same problem with NetBeans 8.0.2 on Mac OS X 10.10.5. Quitting NetBeans and restartiung doesn't help. Only affects the project I am developing - business critical ! Following along the lines of comment 26 I opened project.properties using textEdit and made a non-change, saved, quit and re-opened NetBeans. The problem has gone. Will update if it comes back.
hit same problem on: Product Version: NetBeans IDE 8.0.2 (Build 201411181905) Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 2 Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08 Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18 System: Linux version 3.2.0-4-amd64 running on amd64; UTF-8; it_IT (nb) User directory: /home/riccardo/.netbeans/8.0 Cache directory: /home/riccardo/.cache/netbeans/8.0 I have quit Netbeans, deleted the folder ${build.3Ddir}, after this, it worked. Maybe in my case it is related to the presence of a dot in the name of the project directory? Best regards.
This been's happening on my install of NB too. NB: 8.0.2 OS: Windows 7 x64 JDK: 1.8.0_60
I have observed the same thing happening for the "Test" option. Restarting the IDE fixes this but it is a major annoyance.
Any update on this? I am have been running into the same issue for quite a while now. Earlier a single restart would fix it. But now even restarting multiple time is not enabling the run or compile file menu items. This was working fine about an year or so ago.
As per comment #26, I closed NB 8.0.2, created an empty doc.txt in project src and restarted NB. Run menu is now enabled. Thanks to #26.