I recently wanted to install Visual Editor on Eclipse Helios. Apparently there is an nice way, which works like a charm for me. For more details you can have a look here: http://sourceforge.jp/projects/tmdmaker/wiki/VisualEditor1.4.0ForHelios
Category Archives: Java
Must have Eclipse plugins
From time to time I develop something on Eclipse. Apart from the usual Eclipse operations (build and test) that I do with the Eclipse Ant and JUnit plugins (they ship with Eclipse for Java), I also wanted to carry out some dependency analysis on existing code. Of course JDepend is the obvious option, but I found a nice article from IBM that suggests some additional plugins that help the coder carry out day to day tasks such as Complexity monitoring and Coding standard analysis.
The following is a summary of the plugins proposed by the article. Of course all of them are opensource/free.
Tool | Purpose | URL for Eclipse plugin |
CheckStyle | Coding standard analysis | http://eclipse-cs.sourceforge.net/update/ |
Coverlipse | Test code coverage | http://coverlipse.sf.net/update |
CPD | Copy/Paste detection | http://pmd.sourceforge.net/eclipse/ |
JDepend | Package dependency analysis | http://andrei.gmxhome.de/eclipse/ |
Metrics | Complexity monitoring | http://metrics.sourceforge.net/update |
The full IBM article can be found here: http://www.ibm.com/developerworks/java/library/j-ap01117/
Exception using XMLConfiguration
I tried using the Apache XMLConfiguration to save the settings of an application I am developing to XML format. When I used it with Java 1.5 it all worked perfectly; however if I tried using it with Java 1.6 I was getting the following exception.
Exception in thread "main" java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getXmlStandalone()Z at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source) at org.apache.commons.configuration.XMLConfiguration.save(XMLConfiguration.java:880) at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration$FileConfigurationDelegate.save(AbstractHierarchicalFileConfiguration.java:454) at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:546) at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:513) at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:491) at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:403) at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.save(AbstractHierarchicalFileConfiguration.java:199)
After doing some search on google I found that this can be a problem with the xerces XML library (xercesImpl.jar). Checking the 3rd party libraries I am using in my project, I found a library that was using and distributing an earlier version of xercesImpl.jar.
I downloaded the latest version (2.91) of xercesImpl.jar from the Apache xerces project (http://xerces.apache.org/mirrors.cgi#binary) and replaced in the 3rd party library I was using the xercesImpl.jar file with the one I downloaded. Now everything seems to work fine, even in Java 1.6. 🙂
Spring Cleaning part 2
This is another script I found while cleaning up my hdd. Now, we all know that java .class files can be decompiled to (a version) of their source code. The first java decompiler out there is jad. I tried to decompile some of my class files using jad.exe, but I couldn’t find a way of decompiling multiple .class files at the same time. So instead of digging into the documentation, I decided to quickly create a script that allows me to decompile a number of .class files at the same time.
Here’s how it works! I created a VBScript that goes through a directory (and subdirectories) of .class files and creates a dos batch file. The dos batch file can now be used to run and actually decompile all the .class files!
The VBscript can be found under this link: Decompile_vbs.
You need to edit it and change the paths to the .class and source directories.
When you execute this file, it will create a dos batch file like this one: Example_decompile.bat. Please note this batch file will be generated under the directory where jad.exe exists! You can now run this batch file, which will actually decompile the .class files.
Hard disk spring cleaning
It is time for spring cleaning my hard disk at home. I am sorting/deleting files that I no longer use. I will post here files that I do not need now, but might need in the future.
So… I found a small linux shell script that individually compiles every java file in a directory and all its subdirectories. The code is:
#!/bin/bash
for d in `ls`
do
javac $d/*.java > $d/compile.txt
done
The text file can be found here: batchcompile