Skip to content

OcsJava8

Sebastian Raaphorst edited this page Feb 22, 2016 · 5 revisions

Summary

This pages indicates how to setup your environment to build and run the OCS on Java 8. The description is based on OSX with Yosemite, it may be different in your system

Installation

JDK 1.8 can be installed with a DMG obtained from Oracle at JDK 1.8

After installation you need to change your JAVA_HOME environment var to point to the new installation, typically:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home

However, if need to switch back to a previous release often, you might get some mileage from jEnv: http://www.jenv.be. jEnv lets you quickly switch between java versions and define defaults for certain directories.

Furthermore, while the OCS applications do not require specific locale settings, test cases may fail due to differences in date format parsing if your machine is configured to use anything other than the standard US locale. If you wish to keep your locale as is but still be able to run test cases locally, you can avoid failures by setting the _JAVA_OPTIONS environment variable:

export _JAVA_OPTIONS=-Duser.country=US

Check

Make sure Java 8 is your default before launching sbt

$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

Sbt

You can launch sbt and execute builds as usual. You might notice the following message on startup:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0

if you've defined the -XX:MaxPermSize flag in your startup script. This is harmless and can be left in place in case you need to switch back to previous versions.

OS X Hostname Issues

After updating to 1.8 on a Mac you may experience random network issues like failure to start the spdb with JMX flags turned on or exceptions working with the channel access bundle. Carlos tracked this down to a problem with the hostname and doing

scutil --set HostName localhost

resolved the issues.

Releases

For a releases you need to have the jres for the platforms you want to build, e.g. Windows, Linux[32|64], OSX. You can put them at any place and refer to it in a file called jres.sbt with a content like

ocsJreDir in ThisBuild := file("/Users/<myusername>/jres8")