Archive

Posts Tagged ‘openjdk’

OpenJDK builds for Windows now available from Redhat

June 29, 2016 Leave a comment

As I mentioned in an earlier post, officially supported OpenJDK builds for non-Linux platforms have been notoriously hard to come by in the past, at least until Azul started their Zulu builds in 2013. Unofficial community builds are also available from the ojdkbuild project on Github.

Today Redhat announced that their OpenJDK offerings now include builds for the Windows platform as well.

After Google decided to use OpenJDK in Android N, I guess this is another strong indicator of OpenJDK’s value and increasingly wide adoption.

Advertisements
Categories: java, windows Tags: , ,

Zulu – Certified OpenJDK 8 builds for all operating systems

May 5, 2015 1 comment

You might have heard that Java is Open Source. And then you noticed that the Java SE downloads from the Oracle website are not actually Open Source. Maybe you also heard about OpenJDK.

So how does this fit together?

OpenJDK is an Open Source implementation of Java and Oracle Java engineers do work on Java with the OpenJDK community and and within the OpenJDK projects.

But source code needs to be compiled into executable binaries to be useful for end users. And that’s where things get dicey …

Where to find OpenJDK builds

For a long time there has been no reliable source for certified, well-supported builds of OpenJDK for all platforms.

The various GNU/Linux distributions, like Fedora, Debian, etc, have provided OpenJDK builds for a quite a while now, but for Windows and MacOS there were only some unofficial, often outdated hobby projects without reliable security updates.

Zulu – Open JDK builds

zulu-duke

This changed within the last 2 years: JVM vendor Azul Systems first released their “Zulu” line of free OpenJDK builds in September 2013, mainly targeting Windows Servers and the Microsoft Azure cloud. In 2014 they added support for Linux, MacOS and Java 8, as well as Docker images. All Zulu builds are certified against the official Java SE TCK. The focus is on the JDK and servers, without browser plugin or webstart.

The Azul website does not clearly state their security update policy for their free builds, but they offer deb and rpm package repositories that seem to contain latest builds of OpenJDK that match the current Oracle JDK update versions. Also, their engineers participate in the community and allegedly contribute back to OpenJDK.

Zulu – OpenJDK 8 for Debian stable

For Debian stable (Wheezy or Jessie), Azul is a convenient way to install OpenJDK 8, since the Debian openjdk-8 package is currently only available in Debian unstable and hasn’t even made it into the Debian testing yet.

Here is how I set up the Azul deb repo and installed their OpenJDK 8:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x219BD9C9
apt_source='deb http://repos.azulsystems.com/debian stable main'
apt_list='/etc/apt/sources.list.d/zulu.list'
echo "$apt_source" | sudo tee "$apt_list" > /dev/null
sudo apt-get update
sudo apt-get install zulu-8

Please note, that the package installation automatically sets the Java related system alternatives to the Zulu ones. So right after zulu-8 installation the java version in your system path will be something like this:

oliver@basement:~$ java -version
openjdk version "1.8.0_45"
OpenJDK Runtime Environment (Zulu 8.7.0.5-linux64) (build 1.8.0_45-b14)
OpenJDK 64-Bit Server VM (Zulu 8.7.0.5-linux64) (build 25.45-b02, mixed mode)

How does Java’s Object.wait() really work?

March 10, 2015 Leave a comment

Recently, I came across a question whether Object.wait() uses an “infinite loop”.

I didn’t know the answer, but since the JDK is Open Source, I thought I could at least find out where the code is and look at it.

So for example for JDK 7, these are the steps through the OpenJDK sources:

  1. In Object.java wait() calls the native method wait(timeout) via wait(0)
  2. The native code for wait in Object.c actually uses JVM_MonitorWait.
  3. The JVM wrapper method JVM_MonitorWait calls ObjectSynchronizer::wait.
  4. ObjectSynchronizer::wait calls wait() on an ObjectMonitor.
  5. Finally ObjectMonitor::wait does the real work.

I don’t fully understand that code, but I certainly don’t see an infinite loop in there. :o)

Categories: coding, java Tags: , ,