Today I cameÂ an issue that required me to debug a custom Ant task that we have. While the Eclipse integrated debugger allows you to step through the targets and tasks in the build.xml file using the action Debug As -> Ant Script, it doesn’t actually let you step into the java class that implements the task. This is a major drawback, as most of the complexity (and issues :-)) tend to be in the task implementation code.
After searching around for a bit, I came across the Eclipse Remote Debugger debug configuration. This configuration allows you to remotely debug applications, by establishing a JDWP (Java Debug Wire Protocol, part of JPDA – Java Platform Debug Architecture) connection between the running application and the debugger. After learning about this, setting up the environment to debugg Ant tasks from within Eclipse was pretty straightforward.
The first step is to setup the Ant script launcher to run in debug mode and attach to the debug server. The following should be used as JRE arguments for the Ant configuration:
You can setup your Ant configuration by going to Run -> External Tools -> External Tools Configurations and creating a new Ant Build configuration. Inser the location of the build file in the main tab and setup the arguments in the JRE tab:
After the Ant configuration is setup, we need to take care of the remote debugger configuration. Go to Run -> Debug Configurations… and create a new configuration for Remote Java Application. Make sure you set the same port number that you used in the Ant configuration, and you are good to go.
Now, place the breakpoints in your build.xml and java classes. In order to debug, you need to first launch the Ant script and then attach the debugger to it. Do right click in the build.xml file and select Debug As -> Ant Script. Then go to Run -> Debug Configurations… select the Remote Ant Debugger and click Debug. The debugger will now attach to the running proccess and let you step through both the xml file and the java classes:
Very useful tip from Novel CoolSolutions on how to increase the disk size of a VMWare image: http://www.novell.com/coolsolutions/tip/15344.html
I currently develop mostly in Windows using Eclipse, so I decided to create an openSuse 11.0 vmware image to test some of my code, as our product supports various platforms, including some flavors of Linux. The 10GB disk size soon became too small and now I need to increase it. Here are the steps I had to do:
To resize the guest Os hard disk size, I issued:
vmware-vdiskmanager -x 15GB opensSuse.vmdk
However, step 1 only resized the disk, not the partitions. Starting the partition manager from within the guest Os didn’t work, because the partition can’t be altered while it is still mounted. A simple solution to overcome this issue is to use a Live CD. I still had the openSuse live CD ISO image I used to install the guest Os, so I just pointed the guest OS cd-rom drive to that .iso file.
After booting from the CD-ROM drive, go to Yast -> System -> Partitioner , select the partition you want to expand and click Resize. Select the new size for the partition and click Ok to apply the changes to the partition table.
Reboot your machine and voila! You existing partition will now have the new size.