Faster Clojure REPL Startup With Java 9 Snapshot

After upgrading to Java 8, Clojure development seemed faster due to quicker REPL startup times. So when I saw a snapshot of Java 9 had been released I was hopeful that startup performance would be even faster.

As Clojure runs on the Java Virtual machine (JVM), each time you start a REPL then you wait for a new JVM to start. Other than this REPL startup, Clojure feels faster than developing with Java directly.

Here is how I set up Java 9 Snapshot on my Linux laptop (Ubuntu 14.10), it should be the same for any decent operating system.

Read More

Java 7 on Mac OSX - OpenJDK and Oracle

There are many things that make the MacBook pro a nice machine for software developers. The default version of Java Standard Edition development environment is not one of those things.

Although Java SE does come pre-installed on most OSX versions, it is the soon to be unsupported Java 6 version (unsupported that is without paying Oracle big support fees of course).

Whilst its fairly easy to install Java SE 7 on the Mac, its a little more interesting when it comes to setting it as the default Java runtime environment. If you also want to try installing OpenJDK 7, then there is a little more discovery to be done when locating the install files. This article covers the easiest way I found to install Java SE 7 and OpenJDK 7 together.

Install Java 7

To openjdk or not openjdk, that is the question. On the Mac there doesn’t seem to be much in it when it comes to ease of installation. Both Oracle Java SE 7 and OpenJDK 7 come as dmg files for the Mac, although the OpenJDK files are not as easy to find.

There is a website for the OpenJDK project, although most of the content seems a little dated and unless you are running Linux it provides nothing of interest to help you install OpenJDK on the Mac. Download the latest versions of Java SE 7 and OpenJDK 7 and open the dmg files to install them.

Configure the default Java development environment

OSX allows you to install multiple versions of the Java development environment, a very useful ability especially for testing new versions easily. In the Applications > Utilities folder there is an application called Java Preferences.

Running this application lets you manage multiple version of the Java development environment, Java SE.

When a change is made its effects take place immediately, so if you are working in a terminal and change Java versions then you do not need to restart the terminal.

When you have your new versions of Java 7 installed, use the Java Preferences tool to the order around. If you move an environment to the top of the list it becomes the default choice.

Note that for OpenJDK 7 and Java SE 6 there may be two versions installed. Use the 64-bit version if you have that option.


As the changes take effect straight away, you can go to an open terminal and check that Java 7 is the default Java environment using the java -version command.

Over the next few months I will see what development life is like with OpenJDK 7 as the default. OpenJDK seems to be a newer version than Oracle Java SE, so will have more bug fixes and features - and possibly more bugs.

Using OpenJDK will give me an opportunity to feed back my experiences to the community and if I run into trouble, its easy enough to switch over to Oracle Java SE 7.

Thank you.

This work is licensed under a Creative Commons Attribution 4.0 ShareAlike License, including custom images & stylesheets. Permissions beyond the scope of this license may be available at @jr0cket
Creative Commons License

Java on Ubuntu - Time to Move to OpenJDK!

Oracle have had many ups and downs with the community over the last few years, although recently I though they seemed to be getting things right.

On the one hand Oracle are supporting FOSDEM but with the other hand are stopping the Sun JDK from being shipped freely by Linux distributions.

Is this simply an aggressive way to move everyone over to the OpenJDK platform at a quicker pace?  If it is then its a bit of a big stick to use, when you could just use the carrot of new features in OpenJDK 7 & 8.

Now Oracle has retired the ‘distributor license’ which allowed OS vendors to package Sun JDK (August 2011), the security board for Ubuntu announced that it would be removing Sun JDK package from its ‘Partner‘ repository from 16th February 2012.

“The Sun JDK packages will remain installed on current systems with no further security updates. On new systems, it will no longer be possible to install the packages from the partner archive. “

So if you want a new install of the Sun JDK after February 16th 2012 then you will need to do a manual install by downloading a .bin file from the Oracle website and installing it into /opt or /usr/local/. Or you could have a look at the  package from one enterprising Ubuntu user, Martin Wimpress.

Moving to OpenJDK

Instead of the fiddling with the Oracle version of Java, you could use this move as a good excuse to test drive your Java applications on OpenJDK which is currently available to install through the Ubuntu Software Centre.

I was concerned about moving over to OpenJDK at first until I realised that I had been using OpenJDK for everything for quite a while anyway.  In the last year I have been doing JIRA and Confluence plugin development, using Netbeans IDE and coding with Scala and Clojure all on OpenJDK 1.6 without any issues.  So is it time for us to move over to the OpenJDK platform for good?

In Summary

Its a funny feeling that moving to OpenJDK is not only what a huge commercial organisation wants but also a great boost for open source projects in general and of course the OpenJDK project itself.  The world has certainly changed in the last few years !!

Thank you.

This work is licensed under a Creative Commons Attribution 4.0 ShareAlike License, including custom images & stylesheets. Permissions beyond the scope of this license may be available at @jr0cket
Creative Commons License