Saturday, August 14, 2010

Opening class file present in JAR

Often it happens that you just have jar files without source code and you want to investigate a class present in jar file. It's really easy in eclipse provided you have already installed JAD plugin for eclipse.

What you have to do is not ctr+shift+r but ctr+shift+t and give the class name you want to visit. You should be able to see decompiled class using JAD eclipse plugin.

Monday, August 2, 2010

Remote debugging with Tomcat 6 and Eclipse

Life as a developer is so easier if you know this. What it meant is debugging the code running on another JVM in tomcat. lets see how to configure.
You don't have to make any changes in catalina.bat in bin folder if its tomcat 6. For tomcat 6 default jpda(java platform debugging architecture) port is 8000. So go to the your eclipse and navigate to debug menu. Select Remote java application. Click on new to create new configuration. In project select project you want to debug. In host select host where tomcat is running and port will be JPDA port(In this case 8000). Hit apply and then hit debug. Set your break point. Go to bin folder of tomcat and execute following command to start tomcat.

catalina jpda start

Your are good to go.