I have my Java source code in the standard src/ lib/ test/ directory structure for my project. I want to generate a web view of my source code where I can fire up a browser and see syntax-highlighted, line numbered code. I not only want this but I also want the files to be correctly linked (e.g. clicking on a method/class/interface etc name on the webpage view of the code, it would take me "Eclipse-style" to the relevant page). Is there any piece of software that already does this? I know there is tons of syntax highlight js and css out there so that part is easy and thus I am more interested in the linking part.
Edge/Internet Explorer: CTRL + U. Or right click and select “View Source.” Chrome: CTRL + U.
The source code file has file extension ". java". This is the file that is converted into the Java bytecode file, also called the class file. Everything that you physically code is "source code".
Nowadays, the best way to add Java to HTML is through the so-called JavaServer Pages (JSPs). A JSP page is a file with the extension . jsp. It is an HTML markup containing several JSP tags.
See our Java Source Code Browser. Combines Java source code browsing with JavaDoc style cross references. Hyperlinks on identifiers follow Java's scoping rules fully.
Presently operates with Java 1.4, now completing versions for Java 1.5 and up.
EDIT May 2012: Handles Java 1.6 and Java 7
I think your best bet would be Cobertura. Out-of-the-box it will generate nice HTML versions of your source. As a side benefit, it will also generate your code coverage report as well. ;)
Maven JXR is another option as well (if you are using Maven).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With