Christof Buechi
Christof Buechi

Reputation: 185

Openshift Play2.3 Java8 usage

I'm trying to deploy a Play2 application on Openshift. I'm using the build from scratch feature with the following base: http://cartreflect-claytondev.rhcloud.com/reflect?github=tyrcho/openshift-cartridge-play2

my project want to use java8, which is already installed on:

/etc/alternatives/java_sdk_1.8.0/bin/javac -version
javac 1.8.0_31

/etc/alternatives/java_sdk_1.8.0/bin/java -version
openjdk version "1.8.0_31"
OpenJDK Runtime Environment (build 1.8.0_31-b13)
OpenJDK Server VM (build 25.31-b07, mixed mode)

I tried to set JAVA_HOME with the following techniques:

rhc set-env JAVA_HOME=/etc/alternatives/java_sdk_1.8.0/bin -a insightserver
Setting environment variable(s) ... done

export PATH=/etc/alternatives/java_sdk_1.8.0/bin:$PATH
export JAVA_HOME="/etc/alternatives/java_sdk_1.8.0"

JDK 8 support at DIY cartridge in OpenShift

rhc ssh: touch .openshift/markers/java8

But still:

readlink -f $(which java)
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75/jre/bin/java

Now I don't have any ideas anymore. does somebody know how to switch to java8 ?

Upvotes: 0

Views: 481

Answers (1)

Thomson256
Thomson256

Reputation: 217

This might help? https://github.com/thomson256/play-diy-scripts I have done Play in Openshift with DIY approach, not custom cartridge. So you need the action hook scripts only.

With Play 2.3 the path in action_hooks/start needs to be target/universal/start (line 18), what is the Play's stage folder structre.

Sidenote: i have only hobbyist sites running so far in Openshift, but even them i upgraded as Bronze plan (still free) as with free tier they idle crashed like once per month because little/no use.

Upvotes: 0

Related Questions