Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Hello there for my application I need to set the default JDK for building my packages. Normally I would execute

sudo update-alternatives --config java

But how to do something like this in Launchpad? Because I get the error

/build/buildd/2stream-0.0.2/build.xml:46: Unable to find a javac compiler; is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-6-openjdk-i386/jre"

It needs to build using OpenJDK 7. I did specify it as a build dependency in the control file. I even set JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64. But it didn't work.

Is there another way to make sure the whole compile session will have the JAVA_HOME environment variable. So it will be visible to every application.

UPDATE: I do have openjdk-7-jdk installed and openjdk-7-jre installed but the problem is that for some reason it defaults to openjdk-6 (which I didn't install)

share|improve this question

But are you sure you have OpenJDK installed. Do not forget that there are 2 different packages. JRE which is the java runtime environment. This will allow you to run java applications, but not compile. In order to compile, you will need to install the JDK, java development kit. In ubuntu there is openjdk-7-jdk and openjdk-7-jre. Make sure you have both installed.

share|improve this answer
I've updated my main post – Marlinc Oct 30 '12 at 14:03

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.