Saturday, October 13, 2007

Testing Java2Html with Eclipse Europa and Blogger.com

Although the plugin is a bit dated (version 1.5.0 dates from January 2006), the Java2Html Eclipse plugin seems to be working with the Eclipse 3.3 Europa fall maintenance release (and thus very likely works with all 3.x versions). I downloaded and extracted the plugin to the plugins directory, restarted with the -clean option and I had a new context menu, called "Java2Html". And now for a little test to see what it'll look like here:


/**
 * Type comment
 */
public class Test3 {
  public static void main(String[] args) {
    // Some comments
    System.out.println("Java2Html test");
  }
}


I had to manually remove the <br /> elements as they caused empty lines and obviously I had to remove the html head, body, etc. I also got rid of the table and the div that were generated. Although I made these manual changes afterwards, I still think it's a nice little plugin that'll save lots of time when you want to generate syntax highlighted code from within Eclipse. Obviously this isn't just handy for posting, but it would work great in JavaDoc comments as well (albeit not very readable in the comment itself of course ;-))

1 comment:

Jay Khimani said...

Hey this is something I wished a long. Have a look at Syntax Highlighter at http://qbnz.com/highlighter/. wikipedia uses it a lot... But still Java2Html is very handy...