Server Fault is a question and answer site for system and network administrators. 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

How to install Oracle Java on Debian Wheezy with make-jpkg and fakeroot?

the manual for installing oracle java on debian wheezy is quite clear and understandable:

  • download jdk-7u21-linux-x64.tar.gz from oracle
  • install the java-package
  • run make-jpkg with jdk-7u21-linux-x64.tar.gz

as root running:

make-jpkg jdk-7u21-linux-x64.tar.gz fakeroot make-jpkg jdk-7u21-linux-x64.tar.gz

results in the following error:

You are real root -- unfortunately, some Java distributions have install scripts that directly manipulate /etc, and may cause some inconsistencies on your system. Instead, you should become a non-root user and run:

fakeroot make-jpkg jdk-7u21-linux-x64.tar.gz

which will allow no damage to be done to your system files and still permit the Java distribution to successfully extract.


as normal user running:

make-jpkg jdk-7u21-linux-x64.tar.gz fakeroot make-jpkg jdk-7u21-linux-x64.tar.gz

results both in an warning/error wall.

some of the errors:

dpkg-shlibdeps: warning: Can't extract name and version from library name `'
error: couldn't find library needed by /tmp/make-jpkg.MxvYKHyE3L/install/usr/lib/jvm/j2sdk1.7-oracle/jre/lib/amd64/ (ELF format: 'elf64-x86-64'; RPATH: '')
dpkg-gencontrol: warning: Depends field of package oracle-j2sdk1.7: unknown substitution variable ${shlibs:Depends}
dpkg-shlibdeps: error: cannot continue due to the errors listed above

full output: without fakeroot

with fakeroot

installing works fine:

dpkg -i oracle-j2sdk1.7_1.7.0+update21_amd64.deb

java version:

java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

are the error safe to ignore?

share|improve this question
Do you have java-package installed? – Andrea de Palo Jul 20 '15 at 12:30

First of all, you can ignore the warnings emitted by dpkg-shlibdeps. The errors should hint you towards which packages you need to install in order to satisfy all library dependencies for the JDK.

The reason this happens is that you are building a deb package from a binary distribution, i.e. a precompiled JDK. Usually, Debian packages are built from source, not from binaries. In order to do so, the person building the package would add all libraries the source depends on to a certain file (debian/control). Without those libraries installed, the source cannot be compiled and therefore would not result in a package.

In your case, the whole JDK was already compiled by Oracle and make-jpkg only mimics the process of building a package from source. Therefore you are not required to install all the required libraries beforehand.

To silence the errors you can use apt-file to find out which packages contain the missing files (,,, ...) and install them all.

Or you could just use OpenJDK which comes prepackaged for Debian Wheezy and can easily be installed through apt-get install openjdk-7-jdk.

share|improve this answer

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.