首页 > 解决方案 > 在 Heroku 上部署带有参数的 jar 文件

问题描述

我正在尝试在 Heroku 上部署一个接收两个参数的 jar 文件。

为此,我执行以下操作:

heroku create appname
heroku deploy:jar rest/target/rest-1.0-jar-with-dependencies.jar

但是我收到一条错误消息,指出未指定参数:

app [web.1]: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
app [web.1]: at org.dbpedia.spotlight.web.rest.Server.main (Server.java:86)

原来的jar运行如下:

java -jar rest-1.0-jar-with-dependencies.jar es http://localhost:2222/rest/

第一个参数是文件夹,第二个参数是REST服务的监听地址。

如果有人知道如何做到这一点,我将不胜感激。

提前致谢。

标签: restherokujarheroku-cli

解决方案


推荐阅读