Java Development Kit (JDK) is a bundle of software components that is used to develop Java based applications. JDK is an implementation of either of Java SE, Java EE or Java ME. Usually, learners start from JDK implementation of Java SE to learn core Java features, which is also known as Java SDK. JDK includes the JRE, set of API classes, Java compiler, Webstart and additional files needed to write Java applets and applications. Java Development Kit is a bundle of the following software components that are needed to develop Java based applications.
Java Compiler: Java compiler is javac tool located in /bin folder of the JDK installation directory. The javac tool (accessed using
javac command) reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files. It can also process annotations in Java source files and classes.
There are two ways to pass source code file names to
For a small number of source files, simply list the file names on the command line separated by blank space. For example:
D:\JavaPrograms>javac SelectionSortDemo.java SequentialSearchDemo.java
For a large number of source files, list the file names in a file, separated by blanks or line breaks. Then use the list file name on the
javac command line, preceded by an @ character. For an example, store three source file names SelectionSortDemo.java, SequentialSearchDemo.java, SystemOutPrintlnDemo.java in a file named source-file-list and then supply following command in order to compile the source code files stored in source-file-list.
Inner class definitions produce additional class files. These class files have names combining the inner and outer class names, such as
Java Interpreter: Java interpreter is used to interpret the
.class Java files that have been compiled by Java compiler (
javac). Java interpreter is accessed using
java command. The
java command starts a Java application. It does this by starting a Java runtime environment, loading a specified class, and calling that class's main method.
The method must be declared
public and static, it must not return any value, and it must accept a String array as a parameter. The method declaration has the following form:
public static void main(String args)
By default, the first argument without an option is the name of the class to be called. A fully qualified class name should be used. If the
-jar option is specified, then the first non-option argument is the name of a JAR file containing class and resource files for the application, with the startup class indicated by the Main-Class manifest header.
The Java runtime searches for the startup class, and other classes used, in three sets of locations: the bootstrap class path, the installed extensions, and the user class path.
Non-option arguments after the class name or JAR file name are passed to the main function.
Java Disassembler: The
javap command is the disassembly tool of JDK that disassembles one or more class files. Its output depends on the options used. If no options are used,
javap prints out the package,
public fields and methods of the classes passed to it. The
javap prints its output to stdout.
Java Header File Generator: Java Header File Generator (
javah command-line tool) generates C header and source files that are needed to implement native methods. The generated header and source files are used by C programs to reference an object's instance variables from native source code. The
.h file contains a
struct definition whose layout parallels the layout of the corresponding class. The fields in the
struct correspond to instance variables in the class.
The name of the header file and the structure declared within it are derived from the name of the class. If the class passed to javah is inside a package, the package name is prepended to both the header file name and the structure name. Underscores (_) are used as name delimiters.
javah creates a header file for each class listed on the command line and puts the files in the current directory. Use the
-stubs option to create source files. Use the
-o option to concatenate the results for all listed classes into a single file.
The new native method interface, Java Native Interface (JNI), does not require header information or stub files. The
javah tool can still be used to generate native method function prototypes needed for JNI-style native methods. The
javah tool produces JNI-style output by default, and places the result in the
Java Documentation: Java Documentation helps to maintain code. The
javadoc tool comes as part of Java Development Kit that parses the declarations and documentation comments in a set of Java source files and produces a corresponding set of HTML pages describing (by default) the public and protected classes, nested classes (but not anonymous inner classes), interfaces, constructors, methods, and fields. You can use it to generate the API (Application Programming Interface) documentation or the implementation documentation for a set of source files.
You can run the
javadoc tool on entire packages, individual source files, or both. When documenting entire packages, you can either use
-subpackages for traversing recursively down from a top-level directory, or pass in an explicit list of package names. When documenting individual source files, you pass in a list of source (
.java) file names.
Java Debugger: The Java Debugger,
jdb, is a simple command-line debugger for Java classes. It is a demonstration of the Java Platform Debugger Architecture that provides inspection and debugging of a local or remote Java Virtual Machine.
Java Applet Viewer: This is used to view the Java applets. The
appletviewer command connects to the documents or resources designated by urls and displays each applet referenced by the documents in its own window. Note: if the documents referred to by urls do not reference any applets with the OBJECT, EMBED, or APPLET tag, then
appletviewer does nothing. For details on the HTML tags that
appletviewer supports, see AppletViewer Tags.
Hope you have enjoyed reading about the components of JDK. Please do write us if you have any suggestion/comment or come across any error on this page. Thanks for reading!
Facebook apologises after repeatedly restoring posts featuring stolen photos of children and posted claims they had cancer.A guided tour of the cybercrime undergroundPosted on Wednesday February 22, 2017
Malware researcher Anton talks about who does what in the web's dark marketplaces.Mouse trap triggers internet alertsPosted on Wednesday February 22, 2017
A pest control company develops a mouse trap that connects to the internet.Courtesy BBC News