Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I am trying to compile a program using maven in my Linux 12.04. In order to do, I use the mvn clean install command. However I get a build error:

[ERROR] Unable to locate the Javac Compiler in:
Please ensure you are using JDK 1.4 or above and
not a JRE (the class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.

I check the path and indeed I am missing that critical file. This is what I have:

user@modelX:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib$ ls  im          
amd64                     images            jar.binfmt  
charsets.jar              javazic.jar           resources.jar
classlist                 jce.jar               rhino.jar
cmm                       jexec                 rt.jar
compilefontconfig.jar     jsse.jar              security  jvm.hprof.txt   
ext                       management        management-agent.jar  zi     meta-index

So apparently, I am running openJDK, but I am missing files. How do I fix this?

share|improve this question

1 Answer 1

up vote -1 down vote accepted

Apparently I was missing some important packages. I found the solution in this website:

share|improve this answer

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.