Bluemix Maven SpringBoot构建和部署无效的目标版本

Sco*_*len 2 java spring maven spring-boot ibm-cloud

我创建了一个maven项目并将其附加到Bluemix集成的git存储库.

我可以使用spring-boot:run目标在本地(通过cmd或Spring Tool Suite)构建和运行它.

其他人也可以从Origin中删除代码并在本地计算机上正常运行.

我遇到的问题是通过Bluemix的构建和部署功能构建和部署它.在出现以下错误之前,一切似乎都很好:(目标版本无效:1.8)

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project StudyPlaner: Fatal error compiling: invalid target release: 1.8 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Run Code Online (Sandbox Code Playgroud)

我知道这个错误是围绕java安装的,解决方案通常是确保在运行程序的机器上正确设置java安装和环境变量.但是,我不确定如何在Bluemix Cloud中编辑这些值.例如,我是否需要附加Java运行时微服务,或者是否有可用的默认Java版本?

在此输入图像描述

Java版本在项目的POM.xml中设置为1.8.

关于我如何进步的任何想法?

此外,我们计划继续使用容器,但认为在没有容器的情况下部署是合乎逻辑的第一步.

小智 7

设置Java 7的默认版本.Java 8可用.您可以在此处查看构建环境中安装的各种版本.要使用Java 8,可以将以下内容添加到构建脚本的开头.

export JAVA_HOME=~/java8 export PATH="$JAVA_HOME/bin:$PATH"