Question about executing jar file from PHP

I have a file test.php that looks like

        <link rel="stylesheet" type="text/css" href="mystyle.css" />



$Env = shell_exec('. /home/content/xxx/html/java_env');
$Name = shell_exec('/home/content/xxx/html/jdk1.6.0_24/bin/java -version');
echo "<pre>$Env</pre>";
echo "<pre>$Name</pre>";


This is causing the following error

Error occurred during initialization of VM
Could not reserve space for ObjectStartArray


On the command line in an ssh session I am able to execute this code

java -version

java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)

just fine. I have added flags
-Xms2m -Xmx16m -XX:ReservedCodeCacheSize=32m -XX:MaxPermSize=64m and all others sorts of options but I am getting the same error. All other system commands on linux box excute just fine

I have ready that the tomcat webserver JVM needs to be modified but I am unsure where to do this. The GoDaddy stuff says the problem is with my code. Can anyone shed light on this
Who is Participating?
shariqConnect With a Mentor Author Commented:
I was able to get this issue resolved by using

java  -Xms16m -Xmx32m and none of the other options


shariqAuthor Commented:
Problem solved by bumping up the xms option. Also go daddy tech support says that shared hosting environment does not support the creation of JVM. This is not correct
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.