Guides to Programming Languages & Related Topics



A Coffee, an Indonesian island or a programming language?

Java was conceived in 1991 by a team at Sun Microsystems led by James Gosling. It was designed to be simple, reliable and portable to any type of computer or other platform (e.g. phone, laptop, washing machine). Originally it was intended to work and connect together household devices in a digital home like vision. This idea did not prove popular. However, the huge growth of the internet, the appearance of web browsers in the 1990s and effective marketing by Sun helped guarantee Java's success. Java was ideally suited to the Internet model of computing, and in 1995 it was released for public use. It was very heavily marketed by Sun with great success - It quickly became hugely popular.

Eight out of ten Java programmers prefer Java to C++

Java code looks very similar to C++, but essentially it's not as complex.

As a consequence, Java is easier to program than C++, and generally it's faster to develop software using Java than C++. Actually, it's probably more than eight Java cats that prefer it.

It's compiled Jim, but not as we know it

Where Java differed from most languages at the time was it's not a compiled language. A compiler is a very clever program that takes a collection of source code and produces a executable file which the computer can run directly. This executable file is also known as a program. Languages like FORTRAN, COBOL, ADA, Algol, C, C++, Pascal are all compiled languages. The question is, if Java isn't strictly compiled, how does Java produce executable programs?

Introducing the JVM

Java does use a compiler. But the Java compiler is only the first stage required to run the source code. The Java compiler compiles Java source to an intermediate code known as Java bytecode. This bytecode cannot be executed, it is an intermediate stage in the execution of a Java program. It is the Java Virtual Machine (JVM) which (fortunately for us) understands bytecode and actions the bytecode instructions. The JVM interprets the code rather than compiling it into machine readable code. It deals with any machine specific instructions or limitations of a specific platform. Thus the Java source code does not need to consider any porting issues. The source code remains the same regardless of the target platform on which the software will be run.

One size does not fit all

All that is fine, but Java has a lot of code behind it. Hundreds of megabytes in fact. You can't fit a quart into a pint pot, so how does Java (with it's Write Once Implement Everywhere branding) squeeze into a small device such as a mobile phone or an MP3 player? Small devices only have small amounts of storage and memory. Well, Sun have thought of that. Java comes in three sizes to suit the host platform.

Java ME then has the stripped-to-the minimum variant of Java to squeeze into the MP3 player for example.

OK, but what about JRE and the Java SDK?

More acronyms. They are the bane of modern life. But these two are quite simple.

So, developers would use the SDK, and everyone else runs the smaller JRE.


Post a comment

Just Curious Guides to Technology