构建和运行从NetBeans中的Java应用程序 [英] Building and running a java application from Netbeans
问题描述
我最近开始使用NetBeans,Eclipse的来自未来。
I've recently started using NetBeans, coming from Eclipse.
我有一个简单的实现SnakeYaml第(一YAML解析器的Java)我想测试一下。它被包含在一个主方法
I have a simple implementation of SnakeYaml (a yaml parser for java) I am trying to test. It is contained in a main method.
当我试图像我会在Eclipse中,我得到一个成功的构建,但没有输出运行(F6)。相反,运行我的程序,我需要先构建(F11),然后运行(F6)。有没有我的项目,当我尝试运行它自动建立的一种方式。
When I try to run it (F6) like I would in Eclipse, I get a successful build but no output. Instead, to run my program, I need to first build (F11), then run (F6). Is there a way for my project to be automatically built when I try to run it.
的注意:的Netbeans的居然告诉我,我不必须建立从IDE内运行,但它似乎是在说谎。
Note: Netbeans actually tells me I don't have to build to run from inside the IDE, but it seems to be lying.
推荐答案
@MaxMackie不是一个答案
@MaxMackie not an answer
1)项目 - >属性 - >编译 - >在保存时编译 - 标记检查
1) project -> properties -> compiling -> Compile on Save - mark checked
2)项目 - >属性 - >运行 - >选择main.class(因为你的项目能够包括包含main方法万吨Java类太)
2) project -> properties -> Run -> select main.class (because your project can contains tons Java Classes that contains main method too)
最后一个属性是设置当前项目作为主要项目(我从来没有到需要检查或设置),并检查工具 - >选项 - >键盘布局
last property is to set current project as main project (i never ever to needed to check or set that) and check tools -> options -> keymap
这篇关于构建和运行从NetBeans中的Java应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!