Cannot use oraclejdk7 anymore, update-alternatives error

java
circle.yml

#1

There is a duplicate issue in Mobile category Action failed: Setting Java version to Oracle 7 but this seems not to be a mobile specific problem.

The strange thing here is that I’ve been able to successfully use oraclejdk7 for some time but suddenly it stopped working. I’m not sure if this has something to do with the fact that I changed the build environment from Ubuntu 12 -> 14? I also tried to change back to the previously working environment Ubuntu 12 but the problem persists and my builds keep on failing:

update-alternatives --set java /usr/lib/jvm/jdk1.7.0/bin/java
update-alternatives --set javac /usr/lib/jvm/jdk1.7.0/bin/javac
update-alternatives: error: alternative /usr/lib/jvm/jdk1.7.0/bin/java for java not registered; not setting
update-alternatives: error: alternative /usr/lib/jvm/jdk1.7.0/bin/javac for javac not registered; not setting

update-alternatives --set java /usr/lib/jvm/jdk1.7.0/bin/java
update-alternatives --set javac /usr/lib/jvm/jdk1.7.0/bin/javac
returned exit code 2

Action failed: Setting Java version to Oracle 7


#2

I have this issue too, any news when this will be fixed? Currently installing java 7 with a script and would like to get rid of that extra hassle.


#3

Same here, using Linux 14.04 to build a Java project:

update-alternatives --set java /usr/lib/jvm/jdk1.7.0/bin/java
update-alternatives --set javac /usr/lib/jvm/jdk1.7.0/bin/javac
update-alternatives: error: alternative /usr/lib/jvm/jdk1.7.0/bin/java for java not registered; not setting
update-alternatives: error: alternative /usr/lib/jvm/jdk1.7.0/bin/javac for javac not registered; not setting

update-alternatives --set java /usr/lib/jvm/jdk1.7.0/bin/java
update-alternatives --set javac /usr/lib/jvm/jdk1.7.0/bin/javac
returned exit code 2

Action failed: Setting Java version to Oracle 7

#4

Hello @klindklind, @vharvala, @fzs,

You need to install openjdk-7-jdk package.

Please let us know if you have any questions.

Best, Zak


#5