Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp



Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • 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: 53720
127
  • 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: 22814
119
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!