开发者

Lauch4j .ini file specify jre path

I am using Launch4j with a bundled jre version. The path of the jre version has to be configurable, so I though using the .ini file. I don't understand the documentations on the launch4j website, so I'm coming here for help.

Here is the part of my launch4j config:

<jre minVersion="1.6.0">
    <path>%JRE_PATH%</path>
    <jdkPreference>preferJre</开发者_开发百科jdkPreference>
</jre>

and this is in my myapp.l4j.ini:

-JRE_PATH="D:\builds\jre"

But the exe file always says:

This application was configured to use a bundled Java Runtime Enviroment but the runtime is missing or corrupted

The JRE_PATH variable should be added into the path-element at runtime.

What am I doing wrong?


I took a look at launch4j documentation for its configuration file and also for additional JVM options (which is where xxx.l4j.ini is mentioned).

I think you are misunderstanding what you can do with the .ini file. I think it is just intended as a place where you can specify runtime JVM options (e.g. -D and -X args) for your application. I don't think it's a general purpose variable declaration file.

I don't think that it is valid to use an environment variable in the XML configuration file (%JRE_PATH%). The documentation says this should be a relative or absolute path. I don't think variable substitution is supported in the XML configuration file.


AFAIK the path to the jre is not configurable by the user in the .ini file but you can bundle the jre with your app and specify in the .exe where it is.

See this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜