开发者

NetBeans behaves differently if project is run via "Run Project" or build.xml>run

I slightly modified the build-impl.xml file of my NetBeans project. (Specifically, I made it to insert build time into program code). If I run project via build.xml "run" target, I get behavior I expect - the program displays build time and date. But if I run project using standard (and most obvious, used it always) button "Run Main Project", I get totally another result (no build date). Moreover, if I insert any code into build.xml, I sti开发者_StackOverflow社区ll get result if I run the target explicitly and no result if it is run simply by NetBeans. And this leads me to conclusion, that this button uses another method to run my application. My question is: what does that button do? What method does it call? And can it be configured to run the needed target of make file?


that button runs the main project.. it could be that the current project that you set is not the same as the one you're working on.. additionally, heres the message about build-impl.xml file and build.xml file which may help you:

 *** GENERATED FROM project.xml - DO NOT EDIT  ***
 ***         EDIT ../build.xml INSTEAD         ***

build-impl is a generated file, so your first error is in modifying the code. refer, http://wiki.netbeans.org/FaqMobilityBuildScript

heres some comments on the build.xml file

<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->

hmm, try cleaning up the project and running it again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜