Java 9 Tutorial
java9 Useful Resources
Selected Reading
- Java 9 - Miscellaneous Features
- CompletableFuture API Improvements
- Java 9 - Multiresolution Image API
- Optional Class Improvements
- Inner Class Diamond Operator
- Enhanced @Deprecated Annotation
- Try With Resources improvement
- Java 9 - Stream API Improvements
- Java 9 - Process API Improvements
- Java 9 - Private Interface Methods
- Java 9 - Collection Factory Methods
- Java 9 - Multirelease JAR
- Java 9 - Improved JavaDocs
- Java 9 - REPL (JShell)
- Java 9 - Module System
- Java 9 - Environment Setup
- Java 9 - Overview
- Java 9 - Home
java9 Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java 9 - Improved JavaDocs
Java 9 - Improved JavaDocs
Java documentation can be generated using javadoc tool. It currently generates documentation in html 4.0 format. In java 9, we can generate documentation in html 5 format by using -html5 option in command pne arguments.
Old style java documentation
Consider the following code in C:/JAVA folder.
Tester.java
/** * @author MahKumar * @version 0.1 */ pubpc class Tester { /** * Default method to be run to print * <p>Hello world</p> * @param args command pne arguments */ pubpc static void main(String []args) { System.out.println("Hello World"); } }
Now run the javadoc tool of jdk 7 to generate documentation.
C:JAVA>javadoc -d C:/JAVA Tester.java Loading source file tester.java... Constructing Javadoc information... Standard Doclet version 1.7.0_21 Building tree for all the packages and classes... Generating C:JAVATester.html... Generating C:JAVApackage-frame.html... Generating C:JAVApackage-summary.html... Generating C:JAVApackage-tree.html... Generating C:JAVAconstant-values.html... Building index for all the packages and classes... Generating C:JAVAoverview-tree.html... Generating C:JAVAindex-all.html... Generating C:JAVAdeprecated-pst.html... Building index for all classes... Generating C:JAVAallclasses-frame.html... Generating C:JAVAallclasses-noframe.html... Generating C:JAVAindex.html... Generating C:JAVAhelp-doc.html...
It will create the java documentation page in C:/JAVA directory and you will see the following output.
New java documentation with Search and HTML5 support
Run the javadoc tool of jdk 9 with -html5 flag to generate new type of documentation.
C:JAVA> javadoc -d C:/JAVA -html5 Tester.java Loading source file Tester.java... Constructing Javadoc information... Standard Doclet version 9.0.1 Building tree for all the packages and classes... Generating C:JAVATester.html... Generating C:JAVApackage-frame.html... Generating C:JAVApackage-summary.html... Generating C:JAVApackage-tree.html... Generating C:JAVAconstant-values.html... Building index for all the packages and classes... Generating C:JAVAoverview-tree.html... Generating C:JAVAindex-all.html... Generating C:JAVAdeprecated-pst.html... Building index for all classes... Generating C:JAVAallclasses-frame.html... Generating C:JAVAallclasses-frame.html... Generating C:JAVAallclasses-noframe.html... Generating C:JAVAallclasses-noframe.html... Generating C:JAVAindex.html... Generating C:JAVAhelp-doc.html...
It will create the updated java documentation page in D:/test directory and you will see the following output.
Advertisements