Download |
|
The Java2HTML Tool
Java2HTML is a simple-to-use tool which converts a bunch of Java Source Code into a colourized and browsable HTML representation. Go to download (Version 1.3.1) to get the tool now and/or see some example outputs. You must read the License Agreement before downloading this software.
Java2HTML output has been tested with Microsoft Internet Explorer 4, 5, 6 and Netscape Navigator 4, running on NT and Solaris.
Java2HTML is used by thousands of organizations to publish their source code on the internet, including Sun Microsystems (Java Pet Store Demo 1.3.1) and Oracle (XML Example).
For discussions regarding Java2HTML please subscribe to to our mailing list:-
Main features include:-
Java2HTML can be used from within Ant. View the Java2HTML Task documentation to see how to do this.
Java2HTML can be used from within a Java program by using the Java2HTML API . This is only available in 1.3Beta onwards.
View the Java2HTML API example to see how to use it.
Installing, assumes a certain level of technical knowledge.
Type, " j2h" (if using the script) with no arguments to get a list of options.
Option | aka | Default | Description |
-d <directory> | -destination | output | Specifies the HTML output directory. |
-js <directory> | -javasource | current directory | Specifies the Java Source directory that will be converted to HTML. Repeat for each Java Source directory. |
-jd <directory> [web_reference] | -javadoc | N/A | Used to specify JavaDoc directories that the generated HTML will link to. Specify the optional extra parameter [web_reference] to indicate the web address if the Java HTML is to be accessed from a web server. |
-m | -margin | 0 | Margin size, with Line Numbers. |
-t | -tab | 4 | The number of spaces that Tabs will be converted to. |
-n | -name | Java Source | Name used in the frames. |
-h | -help, /? or j2h with no arguments | N/A | Display Help Options. |
-nh | -noheader | false | prevents the header from being displayed. |
-nf | -nofooter | false | prevents the footer from being displayed. |
-s | -simple | false | Simple output, just include the Java source and stylesheet.css files. Also package links will not be set within the source |
In addition, Java2HTML will produce a "stylesheet.css", in the output directory which can be edited to change the colour or style scheme. (Warning: this will get overwritten if it already exists when you run j2h)
To review the output of running Java2HTML, view the index.html produced in the output directory with your favorite web browser.
I highly recommend the use of the -jd option. You will nearly always want to link into the standard Java libraries, so you will typically supply the following parameter, "-jd C:\JDK1.2\DOCS\API". Use the -jd option for each set of Java Doc you have access to.
Assuming you are using the Dos or Unix scripts "j2h.bat" or "j2h", type the examples for the specified effects.
Examples are from the SUN Microsystems JDK 1.3 Demos. If you experience any strange problems whilst browsing these links, please email a description of the problem to support@java2html.com
j2h -js C:\jdk1.3.1\demo\jfc\Java2D -d examples\Java2D_demo
-jd C:\jdk1.3.1\docs\api http://java.sun.com/products/jdk/1.3/docs/api -n JAVA2D_DEMO
j2h -js
C:\jdk1.3.1\demo\jfc\SwingSet2 -d examples\SwingSet_demo -jd
C:\jdk1.3.1\docs\api http://java.sun.com/products/jdk/1.3/docs/api -n SwingSet_DEMO -m 4
Note: These examples use the web_reference feature of the -jd option, to point the web documentation at the Sun Java website. It would be more typical in general use to point the web_reference at your own local copy of the documentation.
Please send requests for enhancements to support@java2html.com If I use your ideas I will give you a credit in this document.
Please report bugs to support@java2html.com, before emailing make sure that the bug is not listed in Known Limitations and Possible Extensions.
Version | Date | Change |
1.0 | 19th Aug 1999 | Release |
1.0.1 | 20th Aug 1999 | front.html now appears with white background on all mainstream browsers. (See Version Change 1.0.3) |
Fixed JavaDoc URL Reference, now uses "/", instead of "\" which does not work with all mainstream browsers. | ||
1.0.2 | 23rd Aug 1999 | Fixed Java Source URL Reference now uses "/", instead of "\" which does not work with all mainstream browsers. |
Added extra information in the usage description. | ||
1.0.3 | 5th Sept 1999 | front.html now appears with white background on all mainstream browsers. (Accidentally not released in Version 1.0.1) |
when using the -jd option with a single parameter it will now automatically convert the parameter into proper URL references in the JavaDoc links. (This can be done anyway using the second parameter). Requested by Anand Santhanam & David Karr, . | ||
Java2HTML now deals with accented characters properly. Thanks to Gerald Pfarrand & Martin Desruisseaux for spotting that one. | ||
Tidied up HTML generation in many places. | ||
Added manifest file to j2h.jar. This allows Java 2 users to type, "java -jar j2h.jar". Thanks to Martin Desruisseaux for that. | ||
interface A { class B {}; // <-- ';' is problematic } The above code would generate a parse error in Java2HTML. Not anymore. Thanks to Kang Pilsung for spotting that. |
||
1.0.4 | 27th Oct 1999 | Returns exit code, for better integration with Scripting Languages. Requested by Kaze |
Improved Line Number rendering. (Looks a lot better now) | ||
Added more information to front.html. | ||
1.0.5 | 4th Nov 1999 | Fixed typo on front.html. |
Error message inserted into HTML output for Non Legal Java files. | ||
class Foo { SomeObject thing = something;; // <-- Extra semi-colon } The extra semi-colon would generate a parse error. Not anymore. Thanks to Mike for spotting that. You're right Mike, even though it isn't Kosher Java, most of the compilers accept it. |
||
1.0.6 | 17th Nov 1999 | Output messages have been improved. |
Catches Lexical Errors properly. Thanks to Jason King of Sun MicroSystems for pointing that out. | ||
Added Meta "GENERATOR" Tag to all generated pages. | ||
1.0.7 | 31st Oct 2000 | Added Line Number Tags. So you can no use URL references such as, TreeDemo.java.html#80 |
Fixed typos in the j2h usage message. Thanks to Robert Biuk-Aghai of University of Technology, Sydney, for so kindly pointing that out. He also noted a few typos on this page which have also been fixed. | ||
Deprecated the -dir option. Java2HTML now uses a superior (if what slower) two-parse mechanism. | ||
Please note that ownership of Java2HTML has now been transferred to RiteLink Computing Limited. | ||
Added j2h wrapper class. | ||
Added -nh -nf options to remove Header and Footer. | ||
Import lists in source now link to JavaDoc. | ||
Package declaration in source now links to package frame. | ||
Operating System "new line" is used throughout generated HTML, instead of hard coded DOS/NT new line. | ||
Changed 'Package' to 'Packages' text in top left frame. | ||
Fixed single line comment on last line parse failure bug, also spotted by Brad Wells. | ||
1.0.8 | 11th Nov 2000 | Fixed "Project" hyper text reference (top Right hand Corner) to refer to front.html instead of FRONT.HTML. |
1.0.9 | 2nd Feb 2002 | Fixed some HTML output bugs, most importantly line number anchors were not being terminated with </A>. Spotted by a Peter Luschny, Markus.Schmidt and Andreas Schenk |
Changed the instructions on the front page so that 'this' in 'Text displayed like this represents', is in the same style as the actual links within Java Source. Thanks for Christophe Laprun for pointing that out. | ||
Operating System "new line" is now used in the generated stylesheet. Thanks again to Robert Biuk-Aghai for that. | ||
1.1 | 15th Oct 2002 | Footer/Header not correct for Netscape Browser |
Now recognizes .super() method Calls. Spotted by Jim Fisher. | ||
Added Support for Java Version 1.4. | ||
Fixed problem with /**/ when it appeared more than once within a file. | ||
Fixed problem with use of \u9999. (This problem was originally fixed in an earlier version but got reintroduced) | ||
1.2 | 25th Oct 2002 | Expanded the lexical range of characters allowed for a java identifier, requested by Dirk Zoettl |
Added ".java" to the header and changed the background colour. | ||
1.3beta | 2nd Feb 2003 | default.index.html replaces .index.html, Raised by Tanguy PERENNOU |
Moved Java2HTML to an ANT based build script | ||
Numerous changes to the internals of Jav2HTML. | ||
Ownership of Java2HTML Transferred to Polygon Enterprises | ||
Better supports Integration with Ant | ||
Published Java2HTML API. | ||
1.3Beta2 | 22nd Feb 2003 | Fixed 'null' bug when no JavaDoc option was set |
Added -simple option | ||
1.3Beta3 | 23rd Feb 2002 | (Internal changes only) |
1.3Beta4 | 23rd April 2003 | Added Ant Support, recommended by numerous users. |
Fixed -jd command line option problem. Spotted by Cal Holman | ||
Changed the Java2HTML API to support Ant. | ||
Removed references to the deprecated -dir option. | ||
1.3 | 28th April 2003 | No Changes |
1.3.1 | 15 May 2003 | (Internal changes only) |
You should carefully read the following terms and conditions before using this software package. Your use of this software package indicates your acceptance of this license agreement. This is a legal agreement (this "Agreement") between you (either an individual or an entity) and the proprietor of this software. This Agreement is part of the software package.
1. GRANT OF LICENSE. The proprietor hereby grants you a personal, non-exclusive, non-transferable license to use one copy of this Software. This grant of license gives the right to use the software on your computer. You may not decompile, disassemble, or reverse engineer this software, and you may not create derivative works of the this software. You may modify, translate or adapt the generated HTML code. You are not granted any right, title, or interest in the the software except the right to use it in accordance with this Agreement.
2. REDISTRIBUTION Redistribution of the software ZIP file is allowed by shareware and freeware sites or CDROM media and similar without the permission of the proprietor. Redistribution for commercial purposes or reselling is not allowed.
3. WARRANTY. This software and the accompanying files are provided "AS IS," without a warranty of any kind.
4. COPYRIGHT. Copyright is owned by Polygon Enterprises and is protected by United Kingdom copyright law and international treaty provisions.
5. TERMINATION The license will terminate immediately without notice from the proprietor if you fail to comply with any provision of this license. Upon termination, you must destroy all copies of the software and its components on any and all forms of media.
6. LIMITATION OF LIABILITY IN NO EVENT WILL THE PROPRIETOR OR ITS SUPPLIERS BE LIABLE FOR ANY LOST REVENUE, PROFIT, OR FOR DIRECT, SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES HOW EVER CAUSED AND REGARDLESS OF THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF THE PROPRIETOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. GOVERNING LAW This agreement is made under, shall be governed by and construed in accordance with, the laws of the United Kingdom.
Java2HTML is distributed as free software but should a user or company make significant use of it, they are encouraged to make a $50 contribution which gives them registration status and helps towards future development costs. Please click on the following link.
last updated: May 31 2003 |
![]() |
![]() |