Use Ant buildfile or a script to build your Eclipse project

Writing by 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.
EclipseAntBuilder

Did you know you could also debug your Ant Script within Eclipse.
Another great post on IBM Developer Works.

Leave a comment

Category: Eclipse,Java

Eclipse Debugger Hits Unmarked Breakpoint on Exceptions

Writing by 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

Leave a comment

Category: Eclipse,Java

See inherited methods of a class within Eclipse

Writing by on Thursday, 24 of May , 2012 at 9:28 pm

Open the class and use Ctrl + O to show/hide inherited methods.

Leave a comment

Category: Eclipse

Remove obsolete workspaces from Eclipse Workspaces List

Writing by 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.

Leave a comment

Category: Eclipse

How to stop Eclipse from trying to run XML files?

Writing by 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

Leave a comment

Category: Android,Eclipse

Start Eclipse with a specific JVM

Writing by 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

Leave a comment

Category: Eclipse

Shivdev Kalambi's Blog

Shivdev Kalambi is a Software Development Manager, previously a Principal Software Engineer at ArcSight/HP. With over 16 years' experience in software development, he's worked on several technologies and played different roles and contributed to all phases of projects. Non-tech activies include Ping-pong, Rock Climbing and Yoga at PG, Golf, Skiing, Swimming & a beer enthusiast.