将JVM参数放入要在运行时拾取的文件中 [英] Putting JVM arguments in a file to be picked up at runtime

查看:106
本文介绍了将JVM参数放入要在运行时拾取的文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建当前应用程序的jar,这需要设置几个JVM参数.

是否可以在文件中而不是在命令行中设置这些JVM参数?

我已经做了一些寻找,看起来我可以通过设置java-args来使用java.properties文件做某事,但是我找不到用于执行此操作的格式的引用. /p>

我吠错了树吗?

这有可能吗?

如果没有其他方法可以指定JVM参数?

解决方案

您当然可以编写一个批处理脚本来执行JVM.批处理脚本可以调查文件并使用适当的参数进行调用.不过,这将取决于操作系统.

I'm building a jar of my current application, which required several JVM arguments to be set.

Is there a way of setting these JVM arguments in a file rather than on the command line?

I've done some hunting and it looks like I might be able to do something witha java.properties file, possibly by setting a java-args, but I can't find any reference to the format for doing this.

Am I barking up the wrong tree?

Is this possible and if so how?

If not is there some other way to specify the JVM arguments?

解决方案

You could of course write a batch script to execute the JVM. The batch script could look into the file and call with the appropriate parameters. This would be OS dependent though.

这篇关于将JVM参数放入要在运行时拾取的文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆