1

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!

  • 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 01: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 http://serverfault.com/questions/168080/java-vm-problem-in-openvz – Sebastiano Pilla Jul 30 '12 at 09:49

3 Answers3

0

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).

0

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.

orien
  • 314
  • 1
  • 3
0

You don't need to use javac to install Red5. I suggest downloading a tarball from https://github.com/Red5/red5-server un-archiving it and then running red5.sh. That is all you should need to do.

Paul Gregoire
  • 230
  • 1
  • 2
  • 7