GreatWebGuy Self-proclaimed greatness is a hard thing to prove.

21Sep/0717

Decompile Java Classes automatically in Eclipse with JadClipse

There always comes that time, when you're debugging a Java application, when you get to that compiled code inside that open source jar that you added to make your life easier. Whether there's an actual bug or you're just trying to understand some behavior or weirdness you're getting from calling this third party API, sometimes it just helps to see the source. If you're using Eclipse you're in luck, things just got easier, well they've been easy for awhile, but if you weren't aware of jad they just got easier. If you download and unzip the most recent version of JAD, Java's fast decompiler, and add the appropriate Jadclipse plug-in for your version of Eclipse, set a little configuration and your workspace will decompile compiled code automagically. No more ugly class outlines, just raw source code. This is by far one of the essential tools a Java developer should have in their tool kit, just like Firebug for a Web developer. Here are some step by step instructions to get you going, of course I'm assuming you're already using eclipse and have an existing workspace.

  1. Download the latest version of JAD that works with your Operating System from http://www.kpdus.com/jad.html#download
  2. Unzip the JAD executable to a memorable place on your hard drive, I just stuck mine in the bin directory of the JDK
  3. Head over to http://sourceforge.net/project/showfiles.php?group_id=40205 and download the version of the Jadclipse jar that matches your eclipse version, lots of choices here 3.1, 3.2, and 3.3 are covered.
  4. Copy the jar file over to your eclipse/plugins directory, this all depends on where you unzipped and installed Eclipse
  5. If you're workspace was open during all of this, close it and reopen it, if not open it.
  6. Click Window -> Preferences
  7. Expand +Java -> Click on JadClipse
  8. In the Path to decompiler put in the full path to JAD, or put jad in the path variable for your OS, in my case it was C:\Program Files\Java\jdk1.5.0_05\bin\jad.exe
  9. Now go looking in Open Type -Ctrl + Shift + T - for a class you know is in a jar or compiled in your workspace and voila it should open decompiled, classes will also decompile during navigation of method calls from the Console, or their calling classes and during debug
  10. Tagged as: , 17 Comments
16Aug/0720

The functional mess that is Oracle JDeveloper

By corporate mandate I've been using Oracle JDeveloper 10.1.3.1.0.3984, that version number is ridiculous and ought to tell us something, to develop Java EE web applications on and off for about 6 months now and I've never been so frustrated with a development environment in my life. I hear it from seasoned Oracle developers that the wizards are great, you can create web service in a few clicks, you can create an EJB effortlessly, and the application has come such a long way, my God how bad was it before. Honestly, I don't give a flying fuck what you can do with the wizards if the core application is unusable. Coming from an Eclipse/RAD background my gripes are probably slanted, I'm used to being able to do simple things easily and quickly without the IDE flaking out on me completely.

21Mar/0710

An AJAX email contact form using DWR and Scriptaculous

Coming from the Java Server side, my JavaScript skills are pretty limited, a lot of the AJAX frameworks still require a good deal of JavaScript, or wildly complex configurations, not to mention having to take into consideration how you plan to accept and answer the asynchronous calls on the server side. I needed a framework that was easy to configure, was at home in the Servlet Container, and could expose my existing API's to be called asynchronously.

I came across http://getahead.org and their AJAX framework, DWR, and found they had exactly what I needed and at the right price again, free.

Now down to the business of the article. The purpose here is to give some sample source that I worked through in following the directions on GetAhead's website. I had some issues following their directions and figured others might too, some things didn't seem to be working in their examples.

Source for this article is available here: testDWRContactForm.war

Step 1 - Download DWR and add it to your project lib directory
- Download dwr.jar

Step 2 - Add the configuration to load DWR to your web.xml


  dwr-invoker
  DWR Servlet
  org.directwebremoting.servlet.DwrServlet
  
debug
true
  

  dwr-invoker
  /dwr/*
20Mar/0720

Eclipse – Open Resource Shortcut – Ctrl+Shift+R

The biggest time-saver I've stumbled upon in Eclipse is the Open Resource Shortcut. Under the Navigate menu is the Open Resource command, shortcut Ctrl+Shift+R, which opens a window that allows you to type a search for any file that exists in your workspace, in your search you can use the ? to replace a single character or * to replace an entire string, the search is amazingly fast. If you've worked on a project for a long time you know the names of all of your php, jsp's, classes, xml files, and properties, and digging through the folder structure in the Navigator and Project Explorer views can be time consuming and annoying. I've trained my self to use it so much that IDE's that don't have a comparable feature, like JDeveloper, annoy me to no end.

17Mar/0744

Setup Eclipse and Tomcat to play nice together

Eclipse is by far my favorite IDE, which makes Rational Application Developer bearable. The one thing I've been spoiled on in RAD is being able to run the WebSphere Test Environment inside the development environment and be able to have some level of hot deploy when modifying classes or jsp's in the web project. This brings me to my problem with Eclipse and Tomcat, Eclipse provides great support for adding a Tomcat server to run in your IDE, but the default classpath set up forces you to do a build and restart almost everytime you modify a JSP or Class, this is a real pain. The other pain is that by default when you set up a web project, eclipse decides to build your src files into a build directory rather than just building them directly into the web project's WEB-INF/classes directory.

This is what I'm here to solve. I'm assuming your using Eclipse 3.2 (Callisto) with the Web Tools installed, JDK 1.5 or 1.6, and Tomcat 5.5 or 6. May work in earlier versions, but I haven't set up any projects like that recently.