Table of contents

Java

Java is a general purpose object oriented programming language. Java code is statically typed and compiles into Java bytecode, which runs on the Java Virtual Machine (JVM). This allows compiled Java programs to run on many different platforms.

Other than Java, there are many other languages that can run on the JVM, such as Scala, Clojure, Kotlin, and Groovy. These allow you to take advantage of Java’s huge library ecosystem without writing Java code.

Java jargon

  • JVM = Java virtual machine
  • JRE = Java Runtime Environment. This is what you install to run Java programs. Includes a JVM and the standard library
  • JDK = Java development kit. This is what you install to build Java programs. Includes the compiler and other development tools, as well as the JRE.

Release history

Note that the JDK follows a version string convention where JDK 1.8 corresponds to Java 8, JDK 1.9 corresponds to Java 9 etc.

  • 1996 - Java 1
  • 2006 - Java 6
  • 2011 - Java 7
  • 2014 - Java 8
  • 2017 - Java 9
  • 2018 - Java 10

Starting out

Hello world

Save the following to HelloWorld.java.

public class HelloWorld {
    public static void main(String args[]){
        System.out.println("Hello World");
    }
}

Compile with javac HelloWorld.java. This will create a HelloWorld.class file.

Then run with java HelloWorld.

Integrated development environments (IDEs)

A good IDE for Java is Intellij Idea. Download it from https://www.jetbrains.com/idea/download/

Packaging java programs

Java classes can be packaged together in .jar files (Java ARchive).

Common build tools are Gradle and Maven.

Newer language features

Reference documentation

Resources

Java community at GDS

There is an informal Java community at GDS.

Java community meetings are held once a month, featuring presentations, demos and discussions. Join the mailing list to get an invitation. Suggest agenda topics in the Slack channel. Notes from previous meetings can be found in the mailing list archives.

This page was last reviewed on 16 November 2018. It needs to be reviewed again on 16 November 2019 .
This page was set to be reviewed before 16 November 2019. This might mean the content is out of date.