how to pass configuration file to scala jar file

不羁岁月 提交于 2019-12-18 11:42:59

问题


I am using the typesafe config library in my code and then I generate a jar file. The application works fine when I embed the reference.conf file inside the jar. But is it possible to provide the config file as a parameter to the jar ? for example

java -DmyconfigFile=/dir/dir/reference.conf -jar myjar package.class.myobject.

回答1:


Yes it is. See this thread on using an external akka config here.

java -Dconfig.file=/dir/dir/reference.conf -jar myjar package.class.myobject.


来源:https://stackoverflow.com/questions/17623728/how-to-pass-configuration-file-to-scala-jar-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!