This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar and JVM variables when packing

 
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: 48386
56
  • 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
Marshal
Pie
Posts: 20889
75
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