Surname Lastname
Surname Lastname

Reputation: 21

Application runs differently out of Netbeans

I need to run my application with those 2 VM options: (-XX:+UseConcMarkSweepGC -Xmx2048m). I set them into "project properties -> run -> VM options" in Netbeans. Then when i run it in Netbeans it works great but out of Netbeans or on another pc it doesn't.

Is it possible to make my application run always with those VM options? (without setting it in console before running application)

How does it need to be done? (My project properties method seems wrong)

Upvotes: 1

Views: 77

Answers (1)

Tarmo R
Tarmo R

Reputation: 1153

Probably the easiest way is to create a simple batch file, that executes the Java application with relevant options.

java -XX:+UseConcMarkSweepGC -Xmx2048m -jar MyApp.jar

Save this as MyApp.cmd (assuming Windows operating system here) in the same folder as the JAR file and that should be it - just double-click the .cmd file.

This method also needs to have Java in the OS path, but this should mostly be the case nowadays with default java installations.

Upvotes: 1

Related Questions