Reputation: 3546
I created a spring starter app using http://start.spring.io/, downloaded the zip, compiled using mvn install
and pushed the jar to Bluemix :
cf push myspringapp1155 -p target/demo-0.0.1-SNAPSHOT.jar
The application does not start. The output of
cf logs myspringapp1155 --recent
shows:
2015-07-10T11:13:30.25-0400 [App/0] ERR Exception in thread "main" java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=demo/DemoApplication, offset=6
Upvotes: 3
Views: 430
Reputation: 1
Bluemix now supports 1.8 in Liberty build pack. Hence simple cf push command can deploy the app into bluemix using Liberty java.
Upvotes: 0
Reputation: 3546
jar, war and ear files on Bluemix are handled by the Liberty buildpack by default on Bluemix. The Liberty buildpack currently uses Java 1.7 (This might change soon). You can either:
Compile your source using 1.7. Edit your pom.xml
<java.version>1.7</java.version>
or
Use the JBP_CONFIG_OPENJDK environment variable to specify an alternative version of the JRE. For example, to use the OPENJDK 8 set the following environment variable:
$ cf set-env myapp JBP_CONFIG_OPENJDK "version: 1.8.+"
Upvotes: 6