1

I executed

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 update, 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.

  • try executing these commands: which java java -version and then let us know. – Ashu Jul 20 '15 at 23:57
  • I've updated the question. – Edward Falk Jul 21 '15 at 16:37
  • More ... I've downloaded the .deb file directly and opened it up. It definitely contains the files I think it should contain. – Edward Falk Jul 21 '15 at 16:59
2

The files you're looking for aren't in openjdk-7-jre; they're in openjdk-7-jre-headless.

The openjdk-7-jre-headless package installs the following list of files (from Ubuntu 15.10 amd64 installation):

/.
/usr
/usr/lib
/usr/lib/jvm
/usr/lib/jvm/.java-1.7.0-openjdk-amd64.jinfo
/usr/lib/jvm/java-7-openjdk-amd64
/usr/lib/jvm/java-7-openjdk-amd64/man
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8/man1
/usr/lib/jvm/java-7-openjdk-amd64/man/man1
/usr/lib/jvm/java-7-openjdk-amd64/jre
/usr/lib/jvm/java-7-openjdk-amd64/jre/man
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja_JP.UTF-8
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja_JP.UTF-8/man1
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja_JP.UTF-8/man1/rmiregistry.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja_JP.UTF-8/man1/pack200.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja_JP.UTF-8/man1/keytool.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja_JP.UTF-8/man1/orbd.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja_JP.UTF-8/man1/rmid.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja_JP.UTF-8/man1/servertool.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja_JP.UTF-8/man1/unpack200.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja_JP.UTF-8/man1/tnameserv.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja_JP.UTF-8/man1/java.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/rmiregistry.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/pack200.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/keytool.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/orbd.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/rmid.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/servertool.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/unpack200.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/tnameserv.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/java.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/THIRD_PARTY_README
/usr/lib/jvm/java-7-openjdk-amd64/jre/ASSEMBLY_EXCEPTION
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/currency.data
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/images
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/images/cursors
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/images/cursors/motif_LinkDrop32x32.gif
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/images/cursors/motif_MoveNoDrop32x32.gif
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/images/cursors/motif_LinkNoDrop32x32.gif
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/images/cursors/motif_MoveDrop32x32.gif
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/images/cursors/motif_CopyNoDrop32x32.gif
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/images/cursors/invalid32x32.gif
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/images/cursors/motif_CopyDrop32x32.gif
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jvm.hprof.txt
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/javazic.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/classlist
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/management-agent.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/US_export_policy.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/local_policy.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/cmm
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/cmm/PYCC.pf
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/cmm/LINEAR_RGB.pf
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/cmm/sRGB.pf
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/cmm/GRAY.pf
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/cmm/CIEXYZ.pf
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libinstrument.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libj2krb5.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/headless
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/headless/libmawt.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/Xusage.txt
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libjawt.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libjsdt.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libunpack.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libawt.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libicedtea-sound.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libnpt.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libhprof.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libjsound.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libj2gss.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libjaas_unix.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libzip.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libnio.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libjavalcms.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libverify.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libj2pcsc.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libmanagement.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libmlib_image.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jli
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jli/libjli.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libsaproc.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libdt_socket.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libjava.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libsctp.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libnet.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libattach.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libjavajpeg.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jvm.cfg-default
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libj2pkcs11.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libjava_crw_demo.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libjsig.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libjdwp.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libfontmanager.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/management
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/icedtea-sound.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/zipfs.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/sunjce_provider.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/sunpkcs11.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/dnsns.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/localedata.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/meta-index
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jar.binfmt
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jexec
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/compilefontconfig.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/orbd
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/pack200
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/keytool
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/rmiregistry
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/tnameserv
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/rmid
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/servertool
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/unpack200
/usr/lib/jvm/java-7-openjdk-amd64/bin
/usr/lib/jvm/java-7-openjdk-amd64/bin/java-rmi.cgi
/usr/share
/usr/share/doc
/usr/share/doc/openjdk-7-jre-headless
/usr/share/doc/openjdk-7-jre-headless/JAVA_HOME
/usr/share/doc/openjdk-7-jre-headless/NEWS.IcedTea.gz
/usr/share/doc/openjdk-7-jre-headless/README.alternatives
/usr/share/doc/openjdk-7-jre-headless/AUTHORS.IcedTea
/usr/share/doc/openjdk-7-jre-headless/copyright
/usr/share/doc/openjdk-7-jre-headless/changelog.Debian.gz
/usr/share/doc/openjdk-7-jre-headless/README.Debian
/usr/share/doc/openjdk-7-jre-headless/README.IcedTea.gz
/usr/share/binfmts
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/openjdk-7-jre-headless
/etc
/etc/java-7-openjdk
/etc/java-7-openjdk/fontconfig.properties
/etc/java-7-openjdk/images
/etc/java-7-openjdk/images/cursors
/etc/java-7-openjdk/images/cursors/cursors.properties
/etc/java-7-openjdk/sound.properties
/etc/java-7-openjdk/logging.properties
/etc/java-7-openjdk/jvm-amd64.cfg
/etc/java-7-openjdk/accessibility.properties
/etc/java-7-openjdk/net.properties
/etc/java-7-openjdk/swing.properties
/etc/java-7-openjdk/tz.properties
/etc/java-7-openjdk/calendars.properties
/etc/java-7-openjdk/flavormap.properties
/etc/java-7-openjdk/psfontj2d.properties
/etc/java-7-openjdk/security
/etc/java-7-openjdk/security/nss.cfg
/etc/java-7-openjdk/security/java.policy
/etc/java-7-openjdk/security/java.security
/etc/java-7-openjdk/management
/etc/java-7-openjdk/management/jmxremote.password
/etc/java-7-openjdk/management/management.properties
/etc/java-7-openjdk/management/jmxremote.access
/etc/java-7-openjdk/management/snmp.acl
/etc/java-7-openjdk/content-types.properties
/etc/java-7-openjdk/psfont.properties.ja
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8/man1/rmiregistry.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8/man1/pack200.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8/man1/keytool.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8/man1/orbd.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8/man1/rmid.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8/man1/servertool.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8/man1/unpack200.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8/man1/tnameserv.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/ja_JP.UTF-8/man1/java.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/ja
/usr/lib/jvm/java-7-openjdk-amd64/man/man1/rmiregistry.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/man1/pack200.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/man1/keytool.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/man1/orbd.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/man1/rmid.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/man1/servertool.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/man1/unpack200.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/man1/tnameserv.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/man/man1/java.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/man/ja
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/fontconfig.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/images/cursors/cursors.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/sound.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/logging.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/accessibility.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/net.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/swing.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/tz.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/calendars.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/flavormap.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/psfontj2d.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/nss.cfg
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/cacerts
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/java.policy
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/java.security
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jvm.cfg
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjsig.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/management/jmxremote.password
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/management/management.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/management/jmxremote.access
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/management/snmp.acl
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/content-types.properties
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/psfont.properties.ja
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/zi
/usr/lib/jvm/java-7-openjdk-amd64/docs
/usr/lib/jvm/java-7-openjdk-amd64/bin/orbd
/usr/lib/jvm/java-7-openjdk-amd64/bin/pack200
/usr/lib/jvm/java-7-openjdk-amd64/bin/keytool
/usr/lib/jvm/java-7-openjdk-amd64/bin/java
/usr/lib/jvm/java-7-openjdk-amd64/bin/rmiregistry
/usr/lib/jvm/java-7-openjdk-amd64/bin/tnameserv
/usr/lib/jvm/java-7-openjdk-amd64/bin/rmid
/usr/lib/jvm/java-7-openjdk-amd64/bin/servertool
/usr/lib/jvm/java-7-openjdk-amd64/bin/unpack200
/usr/lib/jvm/java-1.7.0-openjdk-amd64
  • I'm going to mark this one "accepted". The thing is, "openjdk-7-jre-headless" isn't an option that Ubuntu Software Center presents to me. (It also doesn't present any form of "openjdk-7-jdk" which I also need). I Just solved the problem myself 30 seconds ago by downloading the .deb file and using dpkg to install it. – Edward Falk Jul 21 '15 at 17:33
  • You do know there is sudo apt-get install openjdk-7-jre, right? – saiarcot895 Jul 21 '15 at 17:34
  • This is part of my love-hate relationship with Linux. How is any ordinary user supposed to figure out how to install Java on their system? – Edward Falk Jul 21 '15 at 17:34
  • Yes, sudo apt-get install openjdk-7-jdk is exactly what I've been doing. That part works fine. It was the jre I couldn't install. And again, how was an ordinary user supposed to figure that out? – Edward Falk Jul 21 '15 at 17:35
  • Yay! My build is working again. I only lost half a day. Thanks for your help. – Edward Falk Jul 21 '15 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.