Java2Html Logo Open source Java (and others) to (X)HTML (and TeX and RTF) converter


Java2Html converts Java (and other) source code (complete files or snippets) to HTML, RTF, TeX and XHTML with syntax highlighting.

This open source Java project consists of an extendible library along with a Java application, a Java applet and many plugins in order to integrate the library into other programs.

Example Output

 * This is about <code>ClassName</code>.
 {@link com.yourCompany.aPackage.SuperClass}
 @author author
public class ClassName extends SuperClass {
  /* This comment may span multiple lines. */
  private int integer = 0;
  public final static char character = 'A';
  // This comment may span only this line
  private String string = "zero";

more examples...

Latest News

February 26th, 2006 new
New version 5.0 and Eclipse plugin 1.5.0 released.
  • Brushed up application an applet: New Swing user interfaces (were AWT before)
  • Contribution from Christian Hujer: XHTML 1.1 output
  • Lots of code cleanup
  • Eclipse Plugin: Preview on preferences page also shows italic
  • Eclipse Plugin: Moved default style control on preferences page to button panel. Better indicates what the controls are meant for.
  • Eclipse Plugin: Extended preview source code to also show Java 1.5 features.
  • Eclipse Plugin Bugfix: modifying style on preferences page caused exception in Eclipse 3.1.1
  • Eclipse Plugin Bugfix: conversion caused ClassCastException on some text editors
January 31st, 2006
The Java2Html homepage has been updated. Hope you like the new design.

more news...


  • Open Source under the GPL or CPL1.0 license (whatever of both fits your needs).
  • Does not depend on a strict grammar: Even parses incorrect Java code (e.g. code snippets) and other text files.
  • Can easily be extended or integrated into other projects (e.g. Wikis).
  • Conversion output can be configured (Color, style,...) - have a look at various style examples.
  • Available as class library, Applet, Ant task, JSPWiki Plugin, Plugin for the Eclipse IDE and others.


  • Does not use a strict grammar - so automatically generating hyperlinks for navigating source files is not possible.


The Application:
Application screenshot
Invoking the Eclipse plugin:
Eclipse plugin screenshot
Eclipse plugin preferences page:
Eclipse plugin preferences screenshot
(click on images to view enlarged version)


Author:Markus Gebhard

Feel free to send me any kind of comments, questions, bug reports, ideas, ...

Don't forget to visit other software projects of mine - especially JDemo.

Valid XHTML 1.0!
© Markus Gebhard (, 2000 - 2008
last modified: May 4, 2008