Java

History

Java™ was first developed in the 90’s by James Gosling. It borrows much of its syntax from C and C++ to be more appealing to existing programmers at the time. Java was owned by Sun Microsystems which was then acquired by Oracle in 2010.

Java is a statically typed, object-oriented language. Statically typed means every variable and parameter must have a defined type (as opposed to languages like Javascript which are dynamically typed). Object-oriented (OO), means that data and functions are grouped together into objects (functions are usually referred to as methods in OO languages).

Java code is compiled to byte-code which runs on a virtual machine (the Java Virtual Machine, JVM). The virtual machine handles garbage collection and allows Java to be compiled once, and run on any OS or hardware that has a JVM. This is an advantage over C/C++ which has to be compiled directly to machine code and has no automatic garbage collection (the programmer needs to allocate and deallocate memory).

The standard implementation of Java comes in two different packages, the JRE (Java Runtime Environment) and the JDK (Java Developement Kit). The JRE is strictly for running Java as an end user, while the JDK is for developing Java code. The JDK comes with the “javac” command for compiling Java code to byte-code, among other things.

At the time of writing, Java is one of the most popular programming languages in use, particularly for server-side web applications.

Openness

In an attempt to make Java more open and community based, Sun Microsystems started the Java Community Process (JCP), which allows a somewhat democratic evolution of Java and JVM specifications. Also, Sun relicensed most of its Java technologies under the GNU General Public License in May 2007 which has resulted in multiple open-source implementations of the JVM (OpenJDK is the official one). Although Sun has many patents on some aspects of the JVM, historically it has not used these patents to sue other companies, which has allowed a healthy ecosystem of competing JVM’s to emerge. Although Oracle sued Google over its use of Java in Android, Oracle eventually lost the case in May 2012.

Generally when we refer to the JVM, we are referring Oracle’s JVM, but OpenJDK or any other JVM can be used.`

The Java Ecosystem

The Java Ecosystem is huge. It is mainly composed of JVM’s, libraries, tools, and IDE’s. It is so huge, there’s no way to really summarize it in one book, but we will cover some of the highlights.

The three most popular IDE’s are (in no particular order):

  • Eclipse - Open-source project by the Eclipse Foundation.
  • NetBeans - Sun’s (now Oracle’s) open-source Java IDE.
  • IntelliJ IDEA - A commercial IDE with a community edition.

We will discuss some of the more promising new libraries and tools in the Java ecosystem, such as the following:

  • Maven, gradle and other build tools.
  • Libraries for concurrent programming.
  • JUnit, spock and other test frameworks.
  • Groovy, Scala, and other JVM languages.
  • Grails, Play, and other web-frameworks.
  • JVM Cloud providers.