Click here to Skip to main content
16,011,374 members
Home / Discussions / Java
   

Java

 
GeneralRe: Heap space option -xms and -xmx Pin
David Skelly22-Jun-10 22:33
David Skelly22-Jun-10 22:33 
GeneralRe: Heap space option -xms and -xmx Pin
002comp22-Jun-10 22:53
002comp22-Jun-10 22:53 
GeneralRe: Heap space option -xms and -xmx (More Detailed way) Pin
002comp23-Jun-10 0:56
002comp23-Jun-10 0:56 
GeneralRe: Heap space option -xms and -xmx (More Detailed way) Pin
David Skelly23-Jun-10 1:45
David Skelly23-Jun-10 1:45 
GeneralRe: Heap space option -xms and -xmx (More Detailed way) [modified] Pin
002comp23-Jun-10 2:00
002comp23-Jun-10 2:00 
GeneralRe: Heap space option -xms and -xmx (More Detailed way) Pin
David Skelly23-Jun-10 3:28
David Skelly23-Jun-10 3:28 
GeneralRe: Heap space option -xms and -xmx (More Detailed way) Pin
002comp23-Jun-10 17:42
002comp23-Jun-10 17:42 
GeneralRe: Heap space option -xms and -xmx (More Detailed way) Pin
David Skelly23-Jun-10 22:38
David Skelly23-Jun-10 22:38 
I understand now, sorry, I was a bit slow on the uptake there.

As far as I am aware, there is no way to set the heap size for executable jar files. If you run the jar by double-clicking, it will use the default heap size for the JVM and you cannot override this in the jar manifest. By the time the jar loads and the manifest is read, the JVM has started and the heap size has been allocated.

So, your options are:


  • If you can live with launching via a batch file, use javaw to set the -Xms and -Xmx values and run the jar using the -jar switch (this is possibly the most usual way to do it).
  • If you really must have an executable jar file that you can double click to run, create a small Java program, all that does is to set up the javaw command line with the parameters you want to invoke your main jar, then execute that via Runtime exec (which would work but it's a bit of a hack)
  • If you don't like that clunky approach, write a little launcher exe in some other language (C, Python, whatever). This is another common way to do things. (I believe this is how NetBeans does it, although I might be wrong there).
  • Use one of the Java to exe tools (something like launch4j). I have never used any of these, so if you go down that route I cannot advise you which is best, or what the pitfalls are.

GeneralRe: Heap space option -xms and -xmx (More Detailed way) Pin
002comp23-Jun-10 22:50
002comp23-Jun-10 22:50 
Questionhow to validate date Pin
kirancgi22-Jun-10 8:17
kirancgi22-Jun-10 8:17 
AnswerRe: how to validate date Pin
Cedric Moonen22-Jun-10 20:29
Cedric Moonen22-Jun-10 20:29 
QuestionRemember password in website Pin
neer117-Jun-10 20:00
neer117-Jun-10 20:00 
AnswerRe: Remember password in website Pin
Richard MacCutchan17-Jun-10 22:01
mveRichard MacCutchan17-Jun-10 22:01 
QuestionEncrypt using java and Decrypt with C Pin
Murugan k16-Jun-10 19:43
Murugan k16-Jun-10 19:43 
AnswerRe: Encrypt using java and Decrypt with C Pin
Richard MacCutchan16-Jun-10 21:30
mveRichard MacCutchan16-Jun-10 21:30 
QuestionSubstring issue Pin
CodeScribbler15-Jun-10 3:11
CodeScribbler15-Jun-10 3:11 
AnswerRe: Substring issue Pin
Richard MacCutchan15-Jun-10 21:56
mveRichard MacCutchan15-Jun-10 21:56 
AnswerRe: Substring issue Pin
David Skelly15-Jun-10 22:35
David Skelly15-Jun-10 22:35 
GeneralRe: Substring issue Pin
CodeScribbler17-Jun-10 2:43
CodeScribbler17-Jun-10 2:43 
QuestionEmulating a serial communication through RFCOMM Pin
ant-damage14-Jun-10 10:36
ant-damage14-Jun-10 10:36 
QuestionNokia 2323 DateTime Issue??? Pin
Member 211994514-Jun-10 2:56
Member 211994514-Jun-10 2:56 
AnswerRe: Nokia 2323 DateTime Issue??? Pin
Richard MacCutchan14-Jun-10 4:39
mveRichard MacCutchan14-Jun-10 4:39 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
Member 211994514-Jun-10 14:22
Member 211994514-Jun-10 14:22 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
David Skelly14-Jun-10 22:48
David Skelly14-Jun-10 22:48 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
Member 211994515-Jun-10 1:51
Member 211994515-Jun-10 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.