Java - Overview

Updated: 2018-12-07

Before You Start Coding

The following concepts may confuse you. Java is full of levels of abstractions, so you will get used to it.

Java vs JVM

  • 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/

JRE vs JDK

  • JRE=Java Runtime Environment

    • JVM is part of JRE
    • if you are just running Java programs, JRE is enough.
  • JDK=Java Development Kit

    • JRE is part of JDK; also has compiler and other components.
    • if you are developing Java programs, JDK is required.

OpenJDK vs Oracle JDK

Java SE vs Java EE

  • 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.

JEP vs JCP vs JSR

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.

Install

Install Prebuilt OpenJDK

Download OpenJDK from http://jdk.java.net/

Extract the package:

$ tar xvzf openjdk-<version>_bin.tar.gz

Add this to ~/.bash_profile or ~/.bashrc:

export JAVA_HOME=/path/to/jdk-<version>

PATH=$JAVA_HOME/bin:$PATH

Then "source" it:

$ . ~/.bashrc

Verify that Java is correctly installed:

$ java -version

Install Prebuilt Oracle JDK

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:

/Library/Java/JavaVirtualMachines/jdk<version>.jdk/Contents/Home

Download Source Code

Follow this guide: http://openjdk.java.net/guide/repositories.html