Background
A few weeks back I developed a plugin for the Go Continuous Delivery server software.My main frustration with trying this on a Mac was that the Go Server installer insisted on locating a Java 6 installation. A bit of Googling revealed that this can be a non-trivial feature to work around, so I gave up trying to run Go on a Mac and tried things out on my work Linux machine.
I only have a limited amount of time at work to do hobby based development, so I went looking for an alternative solution and found the Sample GoCD VirtualBox based environment.
This is pretty cool and enables me to try things out.
Upgrading Java
For my day to day development I have been programming with Java 8 for almost a year (I know it couldn't be a year yet because it wasn't released until mid-March 2014).
The VirtualBox environment only has Java 7 available, so my plugin development was restricted to the features available pre-Java 8.
Long story short, the upgrade steps for making the VirtualBox environment use Java 8 instead of Java 7 are as follows
- Follow the JDK 8 installation instructions:
- http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
- Update the go-server and go-agent files under /etc/default to point to the newly installed JDK's home as JAVA_HOME.
I found the location by tracing through some symbolic links, like so:
With the config changes in place, a restart of the go-server and go-agent processes should get them to use the Java 8.vagrant@vagrant-ubuntu-trusty-32:/etc/default$ ls -la /usr/bin/javalrwxrwxrwx 1 root root 22 Jun 14 2014 /usr/bin/java -> /etc/alternatives/javavagrant@vagrant-ubuntu-trusty-32:/etc/default$ ls -la /etc/alternatives/javalrwxrwxrwx 1 root root 39 Mar 8 12:33 /etc/alternatives/java -> /usr/lib/jvm/java-8-oracle/jre/bin/javavagrant@vagrant-ubuntu-trusty-32:/etc/default$ ls -la /usr/lib/jvm/java-8-oracle/jre/bin/java-rwxr-xr-x 1 root root 5730 Mar 8 12:33 /usr/lib/jvm/java-8-oracle/jre/bin/java
Navigating to http://localhost:8153/go/about should show something like:
Where the JVM version confirms that GoCD is indeed running with Java 8.
Now I can replace my refactoring with some Java 8 goodness.