Java has survived for more than two decades and continues to be one of the top programming languages in use today. What accounts for the language’s success and how has it changed to accommodate more modern technology?
Java’s rise to power
Java initially appeared in 1995, evolving from a 1991 innovation called “Oak”. It was apparently the right time for engineers looking to grow distributed systems. Some of the more popular languages back then — C, C++, and even Cobol for some efforts — involved steep learning curves. Java’s multi-threading, allowing the concurrent execution of two or more parts of a program, ended the struggle to get multi-tasking working. Java quickly became the de facto language for mission-critical systems. Since that time, new languages have come and gone, but java has remained entrenched and hard to replace. In fact, Java has stood as one of the top two computing languages practically since its initial appearance as this Top Programming Languages article suggests.
It was James Gosling at Sun Microsystems, considered as the “father” of Java, who came up with the idea for the language. He worked at Sun until Sun was acquired by Oracle in 2010. In the transference of power, Java became an Oracle product, but hasn’t remained static. Continued innovation have allowed it to remain the most popular programming language. In addition, the Java community has has had time to establish superior tools for writing, maintaining and debugging code.
The appeal of bytecode and portability
Java implementations typically use a two-step compilation process. In other words, the source code is turned into bytecode by the Java compiler. The bytecode is then executed by the Java Virtual Machine (JVM). JVMs today use a technique called Just-in-Time (JIT) compilation to produce native instructions that the system’s CPU can execute. This promotes the “write once, run anywhere” (WORA) approach that Sun espoused in Java’s early days.
Why compilation matters
The flexibility of bytecode provides a real boon to portability. Instead of compiling applications for every platform, the same code is distributed to every system and the JVM in residence manages it. The problem comes in when small footprint devices don’t deal well with the overhead of interpretation that is required. In addition, the Java machine has grown considerably and is far too monolithic for small footprint applications that need to react quickly. As a result, we are seeing offshoots that involve significantly less overhead such as Avian (a lightweight virtual machine with a subset of Java’s features) and Excelsior JET (a complete Java Virtual Machine implementation enhanced with an ahead-of-time compiler) that provide optimized native executables that sacrifice portability for performance. Both cloud and IoT applications benefit.
Other innovations in the Java world include GraalVM and SubstrateVM.
SubstrateVM greatly improves startup time and makes short-lived applications run faster. It’s a framework that allows ahead-of-time (AOT) compilation of Java applications into executable images or shared objects (ELF-64 or 64-bit Mach-O).
Open vs proprietary
Oracle announced last year that the technical differences between JDK and OpenJDK would go away. The differences between the two today is largely cosmetic. OpenJDK vs JDK
Java is still free. Rumors of its imminent death arose a few years back, but OpenJDK has not lost any momentum.
What roles do Oracle and Red Hat play?
When Oracle announced that it would no longer supply free binary downloads for JDK releases or write bug patches for OpenJDK after a six-month period, Java users were initially concerned, but the transition of support has been working well. Red Hat takes over when Oracle backs off. The passing of the baton seems to be smooth and reliable. When Oracle stops providing support, Red Hat takes over.
The key to Java’s continued success
While Oracle and Red Hat continue to provide a gap-free approach to supporting OpenJDK, Java’s earliest developers and these two companies can only claim part of the credit for Java’s eminence. As Red Hat’s Mark Little says, 50% of the credit for Java’s continued success goes to the developer community.