Runnable jar with jvm args

I tried to create a jar executable using Eclipse.
The problem is that the vm parameters that I added to the launch configuration in Eclipse were not saved in any way.

I know that I can create a batch file that will launch the jar with the necessary arguments, but I would prefer that my users simply run the jar.

So my question is, is there a way to pass vm arguments to an executable jar not on the command line?

+7
java eclipse executable-jar
source share
1 answer

In short, you cannot do this without any form of wrapper. You can write a .bat file and / or .sh script to invoke the JVM with the appropriate settings.

You can also check out JavaServiceWrapper , which provides the ability to wrap .jar with executable parameters and allow it to work as a standalone or service (despite its name). It has a set of functions that allow you to control the execution of the JVM in various models.

+3
source share

All Articles