Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed jetty on a CentOS 6 server, but when i try to reach a WAR example of jetty I get this error :

org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac.  A full JDK (not just JRE) is required

yum says that the JDK 1.6 is already installed and when I run

locate javac

nothing relevant is returned.

I added /usr/lib/jvm/java-1.6.0-openjdk- to $PATH

but I think this is still JRE and not a JDK.

I downloaded and executed but it outputs Could not locate a suitable jar utility.

Do someone know how could I install the Java development kit 1.6 on this server ?

EDIT : I updated JAVA_HOME and PATH and I still get the same error. I added the following commands to my bash_profile :

export PATH=/usr/java/latest/bin:$PATH:$HOME/bin
export JAVA_HOME=/usr/java/latest/

But I get an unexpected EOF syntax error

EDIT 2 :

I installed jdk-7-linux-x64.rpm as the other weren't working, which generated new files in /usr/java/. unfortunately, after adding the new path to java it still doesn't work.

thanks in advance

share|improve this question
up vote 5 down vote accepted

You need to install java-1.6.0-openjdk-devel as well.

share|improve this answer
Thanks you very much ! I never seen anywhere that I had to install this package as well – Jerec TheSith May 2 '12 at 14:49
also, use /bin/java instead of /jre/bin/java . – djangofan May 4 '12 at 18:20

So, main answer: once you've found out where javac is, your life will be better if you use the "alternatives" command to set the default javac and java, and then set JAVA_HOME to /usr. Here are simple instructions:

Now, let's try to find javac. I would expect it to be in /usr/lib/jvm/java-1.6.0-openjdk- - does that directory exist? If not, what do you have under /usr/java - is there a /usr/java/jdkxxxx there? If so, check /usr/java/jdkxxxx/bin.

share|improve this answer
after installing jdk-7-linux-x64.rpm and java-1.6.0-openjdk-devel, I located javac in /usr/java/jdk1.7.0/bin/. Thanks for your help – Jerec TheSith May 2 '12 at 15:04

Have you set JAVA_HOME to /usr/lib/jvm/java-1.6.0-openjdk-

share|improve this answer
I set JAVA_HOME to this folder but nothing changes – Jerec TheSith May 2 '12 at 13:33

Your Answer


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.