Sun's java is in Debian Lenny and Debian Squeeze repos (non-free) but no in wheezy1,2. Why?

edit: after further research I found that java has been removed. reson:

ROM; security issues and newer versions cannot be redistributed 3

The following question remains:

Where do I get sun-java packages for Debian Wheezy?

  • it's funny that while googling one of the first results is this page – seler Dec 15 '11 at 22:04
  • SU indexes quickly! :D – Garrett Dec 15 '11 at 22:14

I am not sure that it is because of licensing reasons, since the Sun/Oracle Java is in both Squeeze and Sid.

If you need Sun/Oracle Java on Wheezy, the easiest way is probably to install the Squeeze or Sid version. You can make apt to do that for you by pinning.

Pinning allows you to run certain packages from one version (stable, testing, unstable) without the necessity of upgrading your entire system.

I don't do that at the moment, since I find the opendjk packages adequate for all I need, but I did use pinning in the past for number of other packages.

  • Is's been removed in sid. – seler Dec 15 '11 at 22:14
  • Packages from Squeeze are working. – seler Dec 15 '11 at 22:25

In http://wiki.debian.org/Java there is a link to a helper to generate debian packages from upstream tarballs.

This is maybe the best answer: generating a package each time the people at Oracle generate a new version, but I prefer a different one: having a package with scripts to do the tedious task of installing from a tar.gz.

This is why I have generated a package that does not contain the java framework, but which tells the system just the contrary.

In this way I can upgrade just by manually downloading the tar.gz and running an script.

I know that the package and the script can be improved, but for me is more than enough. It works in i386 and amd64.

If you wanna try it you can download it from http://babel.ls.fi.upm.es/~vpablos/others/packages/debian/


I don't know the right way to install sun-java, but this is my (not so good) solution for Wheezy.

In this example, my Java version is JDK 64 bit.

  1. Download jdk-6u30-linux-x64.bin from www.oracle.com

  2. Extract jdk-6u30-linux-x64.bin to /usr/lib/jvm

    cp jdk-6u30-linux-x64.bin /usr/lib/jvm
    cd /usr/lib/jvm
    chmod 777 jdk-6u30-linux-x64.bin
    rm jdk-6u30-linux-x64.bin
  3. Create a symbolic link to the new directory /usr/lib/jvm/jdk1.6.0_30

    ln -s /usr/lib/jvm/jdk1.6.0_30 /usr/lib/jvm/java-sun

    (This will save time for the next updates. Just remove the link /usr/lib/jvm/java-sun and create the new symbolic link.)

  4. Create symbolic links for the web browser:

    ln -s /usr/lib/jvm/java-sun/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins/javaplugin.so

    Test with a web browser pointing to www.java.com

    rm /usr/bin/java
    ln -s /usr/lib/jvm/java-sun/bin/java /usr/bin/java
    rm /usr/bin/javac
    ln -s /usr/lib/jvm/java-sun/bin/javac /usr/bin/javac

    and so on..

Hope you find a better solution.


Use java-package to build a deb from the upstream tarballs, as explained in the Debian wiki Java/Sun page.


You can try to install the packages for Ubuntu.

You can get them here (edited).

Currently sun-java is in the partner repository, not in the multiverse as it was previously.

You will notice that there is no version for Ubuntu 11.10. Same problem as with Debian, I think.

  • Sorry, they're not working :/ – seler Dec 15 '11 at 21:59
  • You are right. Edited to put the correct link. – jap1968 Dec 15 '11 at 22:30

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.