Java Netbeans 运行项目按钮已禁用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29614191/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 08:19:17  来源:igfitidea点击:

Netbeans Run project button disabled

javanetbeans

提问by Rafi Abro

I have been working on a project, everything was going smoothly and project has no errors. Last saved project was ok and running smoothly but when I opened same project after 2 days the run project button is disabled, no options are available/enable to run my project.

我一直在做一个项目,一切都很顺利,项目没有错误。上次保存的项目正常并且运行顺利,但是当我在 2 天后打开同一个项目时,运行项目按钮被禁用,没有可用的选项/允许运行我的项目。

enter image description here

在此处输入图片说明

in above picture rectangle area in red color where options are disabled. I dont know what should i do, I tried to copy same project and pasted in other location and opened from netbeans.. but still same problem.. How to run this project.. please any one help me out.. thanks

在上面禁用选项的红色图片矩形区域中。我不知道该怎么办,我尝试复制同一个项目并粘贴到其他位置并从 netbeans 打开 .. 但仍然是同样的问题.. 如何运行这个项目.. 请任何人帮助我.. 谢谢

采纳答案by sidewayflower

Disable "Compile on Save" and restart Netbeans.

禁用“在保存时编译”并重新启动 Netbeans。

回答by AWT

This problem happened to me several times before, I used to restart Netbeans and it works every time.

这个问题之前在我身上发生过几次,我曾经重新启动 Netbeans 并且每次都有效。

回答by Venkatesh Bandarapu

restart Netbeans if still not solved then,create a new folder an copy the content of project to that newly created folder then open that new folder project in netbeans.That should work.

如果仍然没有解决,请重新启动 Netbeans,然后创建一个新文件夹,将项目的内容复制到该新创建的文件夹,然后在 netbeans 中打开该新文件夹项目。这应该可以工作。

回答by Thabit

Based on my experience, this happen when you close Netbeanswhile there are errors in the code and the compile on saveoption is working.

根据我的经验,当您关闭Netbeans时代码中有错误并且保存时编译选项正在运行时会发生这种情况。

To solve this problem, just delete the folder Buildfrom the directory of your project folder, and then start Netbeans.

要解决此问题,只需从您的项目文件夹目录中删除文件夹Build,然后启动Netbeans.

回答by Ahmad Hoghooghi

Right click on project name in "Projects" tab and click on "Clean" menu item. This works for me.

右键单击“项目”选项卡中的项目名称,然后单击“清理”菜单项。这对我有用。

回答by joo

My problem was caused by the fact the netbeans didnt know what the main project was.. Press the button named run (not the green run arrow), then set which one of your projects is the main one.

我的问题是由 netbeans 不知道主项目是什么引起的。按下名为运行的按钮(不是绿色运行箭头),然后设置您的哪个项目是主要项目。

回答by Nabila Tajrin

I restarted the NetBeans IDE, and it worked for me

我重新启动了 NetBeans IDE,它对我有用

回答by Majid

Put your mouse over project title, then you'll see the problem preventing project to run.

将鼠标放在项目标题上,然后您将看到阻止项目运行的问题。

回答by karthik sundar

If you have more than one project you need to click on the project to select, then the Run button will be enabled.

如果您有多个项目需要单击该项目进行选择,那么运行按钮将被启用。

回答by Hosein Abdollahipoor

In the project tab, you can Right-clickon your project and click on clean.

在项目选项卡中,您可以Right-click在您的项目上单击clean