Wednesday, November 26, 2008

Debugging applications running in OC4J in Eclipse

Being able to breakpoint your Java code and step through it in Eclipse is essential for timely development.  But every time I go to create a new OC4J debugger instance in Eclipse I don't know where to start! And nothing on the web helped me out.  So here are my settings which work for me.  Hopefully they will work for you too.

A note on versions. I am using Eclipse 3.3.2 and OC4J 10.1.3.2.0 which I have installed at C:\appservers\oc4j10.1.3.2.0.  My Java version is 1.5.0_11.

Click Run -> Open Debug Dialog.  Create a new Java Application and give it a name.  Now configure each tab according to the screenshots.  The project I'm debugging is called regis. I don't know if you have to supply the project or not, but obviously whereever you see regis you'll want to replace that with your own project.

(Click on the screenshots to see a larger version.)

Some of the arguments here are optional. -Xmx512M just gives more memory to the process.

The libraries I have on the Source tab are also optional.  They're useful though when you want to step into Struts method calls etc.

Hopefully after duplicating my settings you are now ready to debug!

No comments: