Java Reference
In-Depth Information
Welcome.java
Java
Compiler
Welcome.class
Java Platform
Java Virtual Machine
Java API
Classloader
Execution Engine
Operating System
Figure 2-19.
All components involved in compiling and running a Java program
Summary
Java programs are written in plain text format using a text editor or IDE. The Java source code is also known as a
compilation unit and it is stored in a file with a
.java
extension. Several integrated development environments (IDEs)
for Java, such as NetBeans, are freely available in the market. Using an IDE to develop Java applications reduces the
time and effort involved.
A Java program is compiled into a class file using a Java compiler. The class file contains bytecode. The Java
compiler that comes with the JDK is called
javac
. The compiled code is run by a JVM. The JDK installs a JVM that can
be run as a
java
command. Both
javac
and
java
commands are located in the
JDK_HOME\bin
directory, where
JAVA_HOME
is the installation directory for the JDK.