doug
doug

Reputation: 2111

How to set java flags when launching a jar from the OS X GUI?

I want the flag "-Xmx1g" to be set when i click on a particular jar file in OS X.

Upvotes: 0

Views: 447

Answers (1)

Martijn Courteaux
Martijn Courteaux

Reputation: 68847

I want the flag "-Xmx1g" to be set when i click on a particular jar file in OS X.

You can't. By clicking the JAR file, OS X will choose the default application for running .jar files. Which is of course java (which is called Jar Launcher in OS X).

What you can do is wrap the JAR into an executable. Launch4j is nice to do this.
Second option is to write a shell script (bash, but with the .command file extension) that invokes your jar using that flag.

Upvotes: 1

Related Questions