sudo apt-get update sudo apt-get install openjdk-7-jre
and the package seems to have installed cleanly, but /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/ was empty except for the program policytool
I installed openjdk-7-jdk as well, and /usr/lib/jvm/java-7-openjdk-amd64/bin/ was properly populated, but /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/ remained empty.
So now I'm in a state where I have javac, jar, javadoc, etc. but no java
$ ls /usr/lib/jvm/java-7-openjdk-amd64/jre/bin policytool* $ find /usr/lib/jvm/java-7-openjdk-amd64/ -name java -print $
dpkg -L openjdk-7-jre indicates that there is no java executable in the package.
dpkg -S /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java indicates that it should be there.
Have I corrupted a database somewhere? How can I fix it?
I've tried the obvious such as disabling ppas in Software Sources, executing
apt-get clean and
apt-get purge openjdk-7-jre and so forth.
Update: I executed these commands:
$ which java /usr/bin/java $ java -version java version "1.7.0_80" $ ls -l /usr/bin/java /usr/bin/java -> /etc/alternatives/java $ ls -l /etc/alternatives/java /etc/alternatives/java -> /usr/lib/jvm/java-7-oracle/jre/bin/java
This is all well and good, but I need to run openjdk 7, not the Oracle version. I'm building Android and the build system is locked to a specific version.
This all worked until yesterday when a
sudo update-alternatives --config java command went wrong and I tried uninstalling and reinstalling the openjdk7 package and it wouldn't reinstall properly.