Java - Overview
The following concepts may confuse you. Java is full of levels of abstractions, so you will get used to it.
- Java is a language, JVM is the virtual machine that Java can be executed;
- Java is not the only language that can run on top of JVM, other examples: Scala, Kotlin, Groovy, Closure, etc.
Both Java language and JVM specs can be found here: http://docs.oracle.com/javase/specs/
- JVM: Java Virtual Machine, most notably HotSpot
JRE: Java Runtime Environment
- JRE = JVM + Library Classes
- HotSpot written in C++ and Assembly, while libraries are written in Java
- if you are just running Java programs, JRE is enough.
JDK: Java Development Kit
- JDK = JRE + Development Tools(e.g. compiler)
- if you are developing Java programs, JDK is required.
- OpenJDK: the open source project, under GPL License.
- Oracle JDK: OpenJDK plus some Oracle's proprietary additions, under a commercial license
- SE=Standard Edition
- EE=Enterprise Edition
Usually when we say Java we mean Java SE. Java EE added some extra packages to SE. There were some overlaps, but JEP 320 removed Java EE modules from Java SE in Java 11.
And you can ignore all other editions(like ME, Micro Edition), no longer relevant.
You may have seen
JEP XXX or
JSR XXX when reading about new Java features, for example, the module system that came with Java 9 can be found in JSR 376: Java Platform Module System or JEP 261: Module System.
- JCP: Java Community Process. The process to make any changes to Java Language and API.
- JSR: Java Specification Request. The formal document used by JCP, to describe the proposed changes.
- JEP: JDK Enhancement Process. Not part of the community but Oracle. Used to describe the changes to OpenJDK.
Download OpenJDK from http://jdk.java.net/
Extract the package:
$ tar xvzf openjdk-<version>_bin.tar.gz
Add this to
export JAVA_HOME=/path/to/jdk-<version> PATH=$JAVA_HOME/bin:$PATH
Then "source" it:
$ . ~/.bashrc
Verify that Java is correctly installed:
$ java -version
Oracle JDK from: http://www.oracle.com/technetwork/java/javase/downloads/index.html
If you are using
.tar.gz, it would be similar to OpenJDK. If you are installing
.dmg on macOS, JDK should be installed in this folder:
Follow this guide: http://openjdk.java.net/guide/repositories.html