I have an ant script that creates runnable jar and I want it to run each time I make changes in my code and save them. I guess I need some "auto build after save" option in Eclipse. Is there such a thing?
By default, you are in auto-build mode and Eclipse takes care of compiling source files automatically. Builds occur automatically in the background every time you change files in the workspace (for example saving an editor). Auto-build is convenient because it means problems view, binaries, etc.
1 Answer. Show activity on this post. If you want to turn off auto Building your project, click the Project menu and uncheck the Build automatically menu. Also available in the Workspace settings: Windows –> Preferences –> General –> workspace --> uncheck "Build Automatically" box.
4 Answers. Show activity on this post. Building workspace is about incremental build of any evolution detected in one of the opened projects in the currently used workspace. You can also disable it through the menu " Project / Build automatically ".
Eclipse source builds provide developers with an automated method for checking out source code and other required resources, compiling the Java code, generating javadoc, and finally, copying launcher files to the right location to launch Eclipse. The end result of a source build is a runnable Eclipse.
You could declare your script as a builder, and make it run "during auto build
".
See the properties of your project: you can add an external program (above) or an an script (below).
If you can export your script as an ant script, like the OP David B did in his answer, it becomes quite easy:
project -> export -> runaable jar file
, tick "save as ANT script
" and finish. project -> properties -> Builders -> new (Ant)
.targets
" tab and click the "set targets
" button next to "auto build
".Actually, the best solution I found was: right-click the project -> export -> runaable jar file, tick "save as ANT script" and finish. Now right-click the project -> properties -> Builders -> new -> paste the path for the ANT file, go to "targets" tab and click the "set targets" button next to "auto build", OK, OK, OK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With