This discussion is archived
4 Replies Latest reply: Nov 3, 2012 3:13 AM by 972301 RSS

Executing terminal command using JavaCode

972301 Newbie
Currently Being Moderated

My requirement is to set JVM heap memory -Xms and Xmx using java code.
I search for this and find out a solution for windows. Wanted a similar solution for Mac as well.
Here is the code which i used for Windows.

Runtime.getRuntime().exec("cmd.exe /c java -Xms250m -Xmx1024m -jar \"application.jar\" /n");

Can any one tell how i can achieve similar kind of functionality for Mac.



  • Correct Answers - 10 points
  • Helpful Answers - 5 points