I have a Java program which required -Xmx1g memory. I am using Netbeans IDE for application developing. I can set this parameter from the IDE,
Right click on the project --> select 'set configuration' --> select 'customize' --> set 'VM option' to -Xmx1g
After setting Xmx value, programe works without any error.
But when I try to run the .jar file from the command prompt, it gives me OutOfMemory error. So I want to set this value in my Java code (e.g.: somewhere in the main method) so I can run the .jar file from the command prompt.
How do I do that?