java Heroku JDK版本问题

eblbsuwk  于 2023-11-15  发布在  Java
关注(0)|答案(1)|浏览(100)

我试图通过CLI在Heroku上部署一个springboot应用程序。我的问题是Heroku默认为JDK 1.8,我需要JDK 17。我在system.properties-java.runtime.version=17和pom.xml -<java.version>17</java.version>中有,但Heroku在部署jar文件时总是安装JDK 1.8。请提供任何建议?
我在这里找不到答案
cerma@cerma-GL503VD:~/git/vendaSkola/target$ heroku deploy:jar VendaSchool3.jar -a vendaskola1 › Warning: heroku update available from 7.60.1 to 8.7.1. Uploading VendaSchool3.jar -----> Packaging application... - app: vendaskola1 - including: VendaSchool3.jar -----> Creating build... - file: slug.tgz - size: 17MB -----> Uploading build... - success -----> Deploying... remote: remote: -----> Building on the Heroku-22 stack remote: -----> Using buildpack: heroku/jvm remote: -----> heroku-deploy app detected remote: -----> Installing OpenJDK 1.8... done remote: -----> Discovering process types remote: Procfile declares types -> web remote: remote: -----> Compressing... remote: Done: 69.3M remote: -----> Launching... remote: Released v3
我试着写信给system.properties java.runtime.version=17, pom.xml - <java.version>17</java.version>,<java.runtime.version>17</java.runtime.version>

k7fdbhmy

k7fdbhmy1#

当你在heroku中运行应用程序时,它实际上是从Heroku示例中获取它,而不是从应用程序中指定的设置中获取它。
尝试使用以下命令运行应用程序
heroku run java -version -a yourapplicationName

相关问题