Writing by shivdev on Tuesday, 5 of March , 2013 at 6:44 am
Let’s say you have a buildfile build.xml that builds your project and deploys to say Tomcat. Wouldn’t it be great to have Eclipse do that for your when you build the project within eclipse? Eclipse has this concept called Builders as part of your project properties that let’s you do just that.
- Right Click the Project -> Properties -> Builders
- Select New
- Select Ant Builder
- In the Main tab
- Buildfile -> Browse Workspace… and select the Buildfile
- Base Directory -> Browse Workspace… and select the Base Directory
- In the Refreshtab
- Check Refresh resources upon completion (recommended in most cases)
- Select The project containing the resource or the option that suits you
- In the Targetstab, select the desired targets from the buildfile
When you build (Ctrl+B) in eclipse, the specified ant target will be run for you and in my case, my application will be deployed to Tomcat.
If you want to run a script, you can do so by selecting Program instead of Ant Builder.
Here’s a screenshot of my Ant Builder.
Did you know you could also debug your Ant Script within Eclipse.
Another great post on IBM Developer Works.
Category: Eclipse,Java
Writing by shivdev on Sunday, 27 of January , 2013 at 7:58 pm
By default, eclipse will suspend the execution on uncaught exceptions and take you directly to the code that you may not really intend to debug. To avoid that set your prefrences:
Window -> Preferences -> Java -> Debug
Uncheck Suspend execution on uncaught exceptions
Category: Eclipse,Java
Writing by shivdev on Thursday, 24 of May , 2012 at 9:28 pm
Open the class and use Ctrl + O to show/hide inherited methods.
Category: Eclipse
Writing by shivdev on Wednesday, 4 of January , 2012 at 6:40 pm
Sometimes you want to avoid clutter in your Eclipse Workspace Launcher and might want to remove obsolete workspaces.
Clean up the value for RECENT_WORKSPACES key, located in the org.eclipse.ui.ide.prefs file.
$ECLIPSE_HOME/configuration/.settings/org.eclipse.ui.ide.prefs
Restart eclipse and it should be gone.
Category: Eclipse
Writing by shivdev on Sunday, 30 of October , 2011 at 10:08 pm
Usually with Android development in Eclipse, you will often be working with XML Files and trying to mess with them. Now while testing your app you will find a file.out.xml that gets created that completely messes up the Android build and shows errors. One way to avoid this is to use the following Settings in Eclipse.
Window -> Preferences -> Run/Debug -> Launching -> Launch Operation -> Always launch the previously launched application
Category: Android,Eclipse
Writing by shivdev on Monday, 29 of August , 2011 at 9:44 pm
If you want to start eclipse with a specific version of Java, use the -vm option.
C:\eclipse\eclipse.exe -vm C:\jdk1.6.0_26\bin\javaw.exe
Category: Eclipse