Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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;
com.sun.tools.javac.Main 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

1 Answer 1

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 –  Marlin Cremers Oct 30 '12 at 14:03

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.