Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to install Red5 on a vps running CentOS 5.7 in MediaTemple using this how-to (dv):Install Red5 Media Server but on step 7 I get this error:

BUILD FAILED
/usr/local/red5/build.xml:217: The following error occurred while executing this line:
/usr/local/red5/build.xml:238: Error running /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/bin/javac compiler

Any idea how to fix it? Already Google and several users have had this same issue but none posted the solution or they never solved.

UPDATE: Some more details: running ant -v dist shows that is a memory problem:

Caused by: java.io.IOException: Cannot run program "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/bin/javac": java.io.IOException: error=12, Cannot allocate memory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
    at java.lang.Runtime.exec(Runtime.java:610)
    at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
    at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
    at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
    at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:522)
    ... 32 more
Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
    at java.lang.ProcessImpl.start(ProcessImpl.java:81)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
    ... 37 more

and I defined _JAVA_OPTIONS="-Xms64m -Xmx128m" and export ANT_OPTIONS=-Xmx128m

and I tried with Xmx512m in both cases, no luck.

Thanks!

share|improve this question
    
Did you look in /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/bin to see if the java compiler was installed there? –  Kev Oct 26 '11 at 21:59
    
Yes, javac is there. –  Julio Menendez Oct 27 '11 at 1:25
    
Is this VPS based on OpenVZ? I had an issue with Java and OpenVZ which looked like yours, in the end the only 2 solutions were either to use the IBM JDK or switch to a Xen VPS. See serverfault.com/questions/168080/java-vm-problem-in-openvz –  sebastianopilla Jul 30 '12 at 9:49

2 Answers 2

Check for reading and execution permissions for /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/bin/javac. Ensure it has the read and execute bits for everyone (chmod a+rx /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/bin/java).

share|improve this answer
    
Come on @Mandx :) You know me better than that. Of course I checked that, yes, javac is executable by all users. –  Julio Menendez Oct 27 '11 at 12:13
    
I can't comment on the question because of my low rep in ServerFault, i didn't want to post this as a full answer, exactly because I know you! :) –  Mandx Oct 27 '11 at 15:54
    
Seeing that the problem is narrowed down to insufficient memory, set the RAM usage to the half of the system for a start. I don't know about Java, but could it be a system/global memory option overriding yours? –  Mandx Oct 27 '11 at 15:57
    
that's what I don't get. The system has 1Gb and as you can see I have set 128Mb for JAVA –  Julio Menendez Oct 28 '11 at 9:48

Your issue here is ant needs to start a new system process to run javac. Unfortunately, you're out of memory to start the new process. Modifying the -Xmx128m parameters and the like will only give more or less memory to the ant process, rather than the new javac process.

My suggestion is to increase the swap space on your box. This should allow you to create more processes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.