Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jar and JVM variables when packing  RSS feed

 
Saeed Anwar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway to configure/pass JVM runtime variables to jar when packing a jar file?

I don't want user to type
java -Xmx512m -jar MyApplication.jar

instead, I want to pass on this info when packing jar file so that when user double clicks on MyApplication.jar JVM knows that it needs 512M of memory.

Thanks for your help.
 
Campbell Ritchie
Sheriff
Posts: 55292
156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know. Look at this and this, but neither seems to mention JVM arguments like Xmx and Xms.
 
BV Boose
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
run it from a script?
 
Henry Wong
author
Sheriff
Posts: 23275
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't want user to type ...


Generally, when you don't want a user to type, the best options are either a shellscript (unix) or batch file (windows).

Henry
 
Saeed Anwar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot everybody.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!