I've recently started using NetBeans, coming from Eclipse.
I have a simple implementation of SnakeYaml (a yaml parser for java) I am trying to test. It is contained in a main method.
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.
Note: Netbeans actually tells me I don't have to build to run from inside the IDE, but it seems to be lying.
解决方案
@MaxMackie not an answer
1) project -> properties -> compiling -> Compile on Save - mark checked
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