Wednesday, 9 July 2025

Hadoop uses OpenJDK

Hadoop uses OpenJDK.  It has a JIRA instance which details bugs and proposed changes. Not all bugs may get fixed especially if related to legacy integrations.

Monday, 30 June 2025

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called

You tried to run an executable JAR file and this happened!

Here's an interesting blog post on sun.misc.Unsafe from Java Magazine.  An example application may be using a Hardware CPU feature unsupported by the current Java version.

Alternatives include the VarHandle API (packaged in java.lang.invoke) as described in this blog post.

JDK 24 - What's up? Almost 150K Unicode characters now supported!

Here are the docs for JDK24.

Note that since Java 11, Oracle stopped offering the JRE as a standalone installer. Instead, the JDK bundles everything: the compiler, tools, and the runtime needed to run Java apps. 

The way to the JVM is thus through the JDK.

So if you are Windows-playing, prepare for an MSI the size of a 200MB rocket ship.

OK, here's the big seller if you don't know whether to upgrade. Unicode 16 is now supported!! Unicode 16, which was released in September 2024, has now been integrated as per JDK-8319993. Woo hoo!!

java.lang.Character which supports the Unicode character database adds 5,185 characters, which brings the total to almost 150,000 supported characters. New scripts supported includes Garay from West Africa.

Checking your install of JDK24 you will likely see something like this:

java --version

java 24.0.1 2025-04-15

Java(TM) SE Runtime Environment (build 24.0.1+9-30)

Java HotSpot(TM) 64-Bit Server VM (build 24.0.1+9-30, mixed mode, sharing)

Wednesday, 29 January 2025

JDK 23 is the latest release of the Java Platform

JDK 23 reached GA on September 2024 and its scope is covered in JSR398. The expert group included experts from Red Hat, Azul, SAP. Oracle and the Eclipse Foundation. The Windows version is only available in 64 bit.

JDK23 introduces the Third Preview for Structured Concurrency whose idea is to simplify concurrent programming incorporating ideas from Erlang (such as hierarchical supervisors).

Groups of related tasks in different threads are treated as a single unit of work, streamlining error handling and cancellation. 

The term Structured Concurrency was coined by Martin Sustrik and popularized by Nathaniel J Smith.

Saturday, 9 July 2022

What are coroutines in Kotlin?

Coroutines in Kotlin are like threads, but not quite like threads. They allow asynchronous computing. 

Their functionality is brought to bear from the library kotlinx.coroutines, developed by JetBrains

Put simply, a coroutine in Kotlin is a unit of suspendable computation Such a computation may be suspended in one thread, then reawoken in another thread. The keyword launch is used to launch a coroutine, and delay suspends the coroutine for a period of time, but does not hog the underlying thread.

Android Jetpack

Jetpack is a collection of useful Android libraries.  A typical Android app will have multiple layers: a UI layer, an (optional) domain layer and a back-end ("data") layer. A candidate for code in the domain layer would be complex business logic that is used across multiple ViewModels.

LiveData and ViewModel are examples of JetPack components. LiveData is interesting, it follows the Observer pattern and notifies Observer objects when the underlying data changes. This way you don't need to write update code in the UI every time the underlying application data changes. Observers have a void return onChanged method that gets called every time data is changed.

Saturday, 8 May 2021

Google's Guava Gets Coverage in Java Magazine

Andrew Binstock covers the 30th major release of Google's all-purpose Guava library in this Java magazine article. One of its benefits is allowing earlier versions of Java to run features that formally came later in the Java canon.

Monday, 28 September 2020

JDK 15 Reaches General Availability on 15 September 2020: EdDSA Embraced, Nashorn Expelled

 JDK 15 is unleashed

One of its fine features is support for EdDSA (Edwards Curve Digital Signature Algorithm described in RFC8032), an elliptic curve signature scheme. The Edwards Curve is named after the late American mathematician Harold Edwards who graduated with a PhD in mathematics in 1961 from Harvard.

One of JDK 15's high-profile "subtractions"is the Nashorn JavaScript engine (which has been removed as per recommendation of JEP372). Nashorn has been declared "challenging to maintain" with the rapid development of the ECMAScript standard underlying JavaScript.

The Z Garbage Collector gets a boost from being a mere "experimental feature" to now becoming a "product feature" as per JEP377 (without altering the default GC which remains G1). Nod to 377 author Per Liden.

Tuesday, 1 October 2019

Scalable Database Building with Cassandra

What is it that makes Cassandra just so scalable? Certainly, it supports clusters spanning multiple datacenters. Some of the principles it follows are as follows:

1. No single points of failure (Decentralized)
2. Fault tolerance through Replication to multiple nodes, enabling failing nodes to be replaced without data loss
3. High performance (as measured in benchmarking against other NoSQL databases)

The Weather Channel, CERN and Instagram are among the top-billed users of Cassandra.

Monday, 30 September 2019

Apache Kafka

Apache Kafka is a distributed event streaming platform. 

It supports publish, subscribe operations (similar to a message queue) and stores streams of records in a fault-tolerant way.

The basic object in Kafka is an array of bytes with some optional metadata known as the key. 

Messages may be structured according to a schema (possibly using JSON or XML) although Apache Avro, a serialization framework for Hadoop, is increasingly popular. Avro supports strong typing and schema evolution.

The Real Kafka - Kafka was a writer who was born in Prague (at the time part of the mighty Austro-Hungarian empire). His well-known works include "Die Verwandlung" (The Metamorphosis) first published in 1915.

Thursday, 26 September 2019

Convergence of Oracle JDK and OpenJDK

Donald Smith at Oracle (Sr. Director of Product Management) announced in 2018 that Oracle JDK and OpenJDK will soon converge with the intent that there are no technical differences in binaries.

Monday, 12 August 2019

What is OJVM?

OJVM is Oracle's database embedded JVM. The code runs in the same memory space as SQL and PL/SQL. It currently supports Java 8.

Saturday, 9 March 2019

Polyglot Runtime - GraalVM

Graal is a JIT compiler with multi-language support. It is based on Oracle's JDK8 with JVMCI support. Languages supported include Python, R and Ruby.

Tuesday, 18 September 2018

All Eyes on Java 10

Java 10 release notes (including update releases) can be found here. The Java 10 API specification can be found here.

JDK 8 on the Out

Oracle will stop updating Java 8 commercially from January 2019. All focus now should be on the latest feature release Java 10 (with a nod to new kid on the block, Nashorn, from Java 9 onwards).

Saturday, 15 September 2018

Remind me again - what is a REPL environment?

Suppose we are comparing various JavaScript engines for the JVM. One criteria for comparison might be whether they provide a REPL environment for the JVM - basically, an environment where you can type in quick commands to test out the language and interact with Java libraries dynamically.

More formally, REPL can be defined as a Read-Eval-Print loop, with the read function taking in the expression (rather than a full-fledged compilation unit), eval evaluates and print prints the result. JShell is a REPL included in the JDK since Java9.

Monday, 6 August 2018

Nashorn and the OpenJDK

Nashorn is a JavaScript engine used in the Java programming language and is based on the Da Vinci machine (prototype to extend the JVM to support dynamic languages, and reference implementation to JSR292. Danny Coward who was the specification lead was originally at Sun and now at Liquid Robotics). (Note: Nashorn is German for rhinoceros).

What does it mean to use a library in "shaded form"?

Shaded form refers to using an open source library in a project but renaming the packages to avoid namespace collisions. For example, the ASM library is used in shaded form in Kotlin and Gradle.

Thursday, 5 October 2017

New Version of JMC in Java 9

JMC6 is the new version of Java Mission Control in Java 9. JMC delivers Java monitoring and management. It supports automated analysis of so-called "flight recordings".

Wednesday, 4 October 2017

Expanding the OpenJDK Community via Projects

OpenJDK expands via Projects. Learn more here on the roles of Author, Contributor and Committer.