JVM options in build

I’m trying to get some JVM options in my app at run time. I have them set in the project properties and verified they where in the project.properties file. The app runs in the SDK but when I build the project the JVM options don’t apply at run time.

I double checked by running the jar from command prompt with.

-Xmx128m -Xms24m -XX:MaxDirectMemorySize=512m

The application ran fine but if I launch the jar directly my options aren’t applied and I get a crash.

How do I get these options into the build ?

http://launch4j.sourceforge.net/

It doesn’t allow to jar run with JVM options, but it allows make launcher built-on jar that supports your nasty JVM options.

Nasty lol , the sdk uses 4 times the amount memory as default :smile:

There should be a simpler way than using a wrapper.

Well, you can run jar via command promt and add JVM options
Like:
java -Xms256m -Xmx512m -Djava.awt.headless=true -jar filename.jar
But wrappers are really easy…

Aye , that is way to much to ask the user. I’m looking for a way to include the launch options as part of the build configuration.

That’s what he’s trying to tell you. Launch4j creates a tiny executable (Platform-native, too!) that will launch the JVM with whatever options you embed. All the user has to do is double-click it.

I know but I was hoping to make it possible for the user to be able to click the .jar directly.

Make a .bat file? The SDK includes the command line options in its desktop deployment ways btw (be it via launch4j on windows, app wrappers on mac or shell files on linux). For a .jar, it can’t include JVM parameters.

Aye , I’ll use the wrapper for now. I misunderstood and thought the jar itself could have a launch option.

99% of users think that EXE is the key of a program, while JAR is something weird. There is no need to fear players :wink:

I thought double clicking the steam icon was the key :stuck_out_tongue:

On the good side. I’m done with the core of Jpony. The only things I have to do now is design levels and write AI then profit. My mission outline has always been

1.) Jmonkey
2.) ???
3.) Profit $$

??? - Is not just ???. But pain, marketing, recruting, promoting. Fat Gabe is not going to make your game popular. Making a game is only half of a way.

It’s joke from south park.

I know this joke! I made it a little bitter.

1 Like

I use the jfxpackager for creating native builds for win/lin/mac. :slight_smile:

The 3.1 SDK uses the same binaries as javafx but allows you to deploy from any platform to any platform, as well as downloading and embedding the JRE for each platform automatically.