in Java programming course

A short (boring) story of the Java Programming Language

A brief summary of the story of the Java Programming Language and its main characteristics

Every respectable Java course/book starts telling you how and when this language was born;

I know you are thinking something like:

too boring for me! I have no time to waste! I have to learn Java!

Obviously I’m joking but (as a matter of facts) I have to do this so I promise you I will not be (too) boring.

I will make a little summary just to give you the flavor on how things have gone.

It all started in 1991, when James Gosling from Sun Microsystems created the Java programming language. The first public release of Java 1.0 was in 1995. In 2006 Sun made Java available under the GNU General Public Licence (GPL). Sun Microsystems was acquired by Oracle Corporation in 2010 which is keeping the open-source project active under the name of OpenJDK.

The latest version of Java (now that I’m writing) is Java 1.8 better known as Java 8.

Portability: Java’s strenght

The main target of the Java Programming language was:

Write once, run anywhere

This slogan was invented to illustrate the cross-platform benefits of the Java language. In other words they wanted to create a programming language to allow developers to write their programs just one time without caring about the target computing-platform. In other word compiled Java code can run on all platforms that support Java without the need for recompilation.

This is achieved by compiling the Java language code to an intermediate representation called Java bytecode, instead of directly to architecture-specific machine code. The compiled bytecode is then executed by the so-called Java Virtual Machine (JVM) which is a program specifically written for the platform on which it is installed.

The next picture clearly depicts this scenario:

Java code compilation and execution

Java code compilation and execution

Once your source code is ready all the .java files are compiled by the Java Compiler into ByteCode .class files. Then the obtained bytecode can be executed by any host running an instance of the Java Virtual Machine independently from the underlying Operative System/hardware.

So what is Java made of?

  • A programming language
  • A compiler (what you need to compile your source code to ByteCode)
  • A runtime (what you need to execute your compiled ByteCode)
  • Core libraries (we will talk about them in the future, for now you just have to know that libraries make a developer’s life easier).

What do I need to execute Java code?

  • JRE (Java Runtime Environment) – enables each host to execute Java Bytecode – it includes the Java Virtual Machine, the standard libraries (API Java) and a launcher needed to start programs that are already compiled into ByteCode.

What do I need to develop in the Java language?

  • JDK (Java Development Kit) – it contains all the tools needed by a Java Developer, I will only quote three of them:
    • javac – the Java compiler needed to compile source code into ByteCode.
    • java – the interpreter of the ByteCode generated by javac.
    • javadoc – creates documentation starting from the comments in the source code.
  • A Good IDE (Integrated development environment) – For example Eclipse or Sublime Text. I prefer this last one even if it can seem a little bit too raw.

Java Programming language fundamental characteristics

The Java language has the following main characteristics that make Java different from other programming languages:

  • Platform independence – As we saw before portability is achieved using an abstraction layer offered by the Java virtual machine. This allows to execute the same Java source code on different operating systems such as Windows, Unix or OS X.
  • Object-oriented – In Java everything is an object (except primitive types).
  • Strongly-typed programming language – Java is strongly-typed, e.g., the types of the used variables must be pre-defined and conversion to other objects is relatively strict.
  • Interpreted and compiled language – Java code is compiled into ByteCode and then interpreted by the Java Virtual Machine.
  • Automatic memory management – In Java the developer/and so it’s software has no direct access to memory; Java automatically manages the allocation and deallocation of memory for managing new objects. A tool called the garbage collector automatically deletes unused objects.

Now that we have a first overview on Java we can get serious and examine deeper aspects.

Stay tuned for the next lesson!

If you liked this article please share it with your friends using the social buttons below.