Javaland is notorious for its acronyms, inconsistent and redundant naming, bundling of multiple things into new definitions, circular definitions, and so on.
This file aims to reduce this incomprehensible mess into a set of succinct definitions. This should read like a dictionary, where all definitions only refer to prior definitions.
Java bytecode refers to two things:
-
A stack-oriented programming language. (It is analogous to the Common Intermediate Language on the CLR or Intermediate Language in LLVM.)
-
A format/syntax which encodes this programming language. This is a binary format which is efficiently machine-readable. It is analogous to LLVM bitcode.
.class file. A file containing Java bytecode.
Java Archive (JAR). A subset of the ZIP file format which contains multiple .class files, any associated resources, and an optional META-INF/MANIFEST.MF
file containing metadata. The format is specified by Oracle.
Web Application Archive (WAR). A subset of the Java Archive, required to have a configuration file /WEB-INF/web.xml
.
.jar file. A file containing a Java Archive. (A Java Archive file may have any extension.)
.war file. A file containing a Web Application Archive.
Java Class Library (JCL). A Java Archive available (as rt.jar
) to all Java bytecode programs. It provides a standard library (for example, abstracting over typical OS facilities to provide an OS-agnostic environment). Multiple JCLs exist and provide different APIs:
- Connected Limited Device Configuration (CLDC). (Comes with the Java ME platform.)
- Standard Edition (Java SE) library. This is a superset of CLDC. (Comes with the Java SE platform. Confusingly, there is no name for the class library that is part of this platform.)
- Enterprise Edition (Java EE) library. This is a superset of the Standard Edition library. (Comes with the Java EE platform. Confusingly, there is no name for the class library that is part of this platform.)
- Java Card class library.
Java Virtual Machine (JVM). This refers to two things:
-
A logical abstract machine which executes Java bytecode. The syntax and semantics for Java bytecode are specified by Oracle by describing the logical JVM.
-
Implementations of the JVM. (Hereon, the specification will be referred to as "the JVM", and implementations as "JVM implementations".)
HotSpot. The JVM implementation provided by Oracle.
The java
tool.
A JVM implementation is exposed as a command-line program called java
.
Given a file Foo.class
, the bytecode in this file can be executed by running java Foo
.
Given a file Foo.jar
, the main .class file can be executed by running java -jar Foo.jar
.
Java Runtime Environment (JRE). A combination of a Java Class Library and a Java Virtual Machine.
Java the language. An object-oriented, statically typed programming language, specified by Oracle. Note that Java the language is not logically connected to the JVM. Many languages compile to the JVM, and Java the language compiles to more than just the JVM. (Confusingly, the specification for the JVM is bundled with the specification of Java the language, as part of Java SE.)
Java Platform. A specification which defines the Java Virtual Machine, Java the language, and a Java Class Library. There are multiple platforms which vary in the Class Library that they define:
- Java Platform, Micro Edition (Java ME).
- Java Platform, Standard Edition (Java SE).
- Java Platform, Enterprise Edition (Java EE).