0

The JWrapper support page directed me to ask this question here so:

I've successfully used JWrapper to create deployment files for my application. A lot of command line stuff is involved and I want to cut down on these. My question is, will the method above help, and how to use it, and effectively? Since other sources of info on JWrapper are either gone or need more detail, I want to request for answers here.

Adam Law
  • 542
  • 1
  • 7
  • 21

1 Answers1

1

When you use the JWSystem.forkVirtualApp method the command line args will be the same as you specify in the jwrapper XML file for all your virtual apps, the command line args that you can pass in are command line args for your virtual app rather than for the JVM launch.

We have an open request to make the JVM args more flexible in general / editable at runtime which I would say would encompass your request and a bit more (we'll note your interest on it too), but for the main requirement of ensuring you are using the same JWrapper-bundled JRE and not the system JRE you can use JWSystem.getMyJreHome. This will always return the JRE that was used to launch your existing virtual app and you can build a custom launch from there.

JWrapper could support a more arbitrary Java launch but it wouldn't provide anything much more than the JWSystem.getMyJreHome + building the path to the java executable so I'm not sure it would provide much if any benefit over JWSystem.getMyJreHome + the Java process builder API?

It could also easily support custom JVM args in the launch but we would want to consider whether it makes sense to add this as an API in addition to a more complete ability to have runtime editing of the JVM args for virtual apps. It is something we plan to look into though.

AntonyM
  • 1,602
  • 12
  • 12
  • I encountered a use case that needs more robust launching options. If an app is encrypted with JWCrypt, it can no longer be launched using ProcessBuilder, thereby eliminating the ability to define the JVM environment e.g. memory settings. Some apps need a dynamic method, as opposed to being restricted to the settings dictated by the jwrapper xml file during build time. – Adam Law May 08 '16 at 17:29
  • sorry, forgot to ping you. – Adam Law May 10 '16 at 10:21