我已经在我的应用程序中更新了 java 版本,现在收到以下错误
[ERR] Exception in thread "main" java.lang.UnsupportedClassVersionError: com/spatial/batch/BatchApplication has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
我添加了 JBP_CONFIG_OPEN_JDK_JRE: '{jre: { version: 11.+ }}'
来解决这个问题,它有帮助。现在我想对 scdf 任务做同样的事情。我试过这样做,但它不起作用
spring:
cloud:
deployer:
cloudfoundry:
domain: ****
freeDiskSpacePercentage: 15
org: ****
password: "****"
space: ****
url: "****"
username: ****
api-timeout: 360
javaOpts: -Xms512m -Xmx768m
skip:
ssl:
validation: false
stream:
buildpack: java_buildpack_offline
services: "p-rbt"
task:
buildpack: java_buildpack_offline
services: "config-server,config-server-keystore,p-rbt,logstash-syslog,elastic-apm"
disk: 4096
memory: 4096
taskTimeout: 540
health:
check: none
env:
JBP_CONFIG_OPEN_JDK_JRE: '{jre: { version: 11.+ }}'
将环境变量设置为 scdf 任务的正确方法是什么?
回答1
env 的位置不正确。它应该仍在清单文件下。但不是应用程序 yaml。 env:JBP_CONFIG_OPEN_JDK_JRE:'{jre:{版本:11.+}}'