Debian 7 stable as most stable Debian releases includes custom Open Source Oracle Java Virtual Machine version called IcedTea OpenJDK, just like with sun's proprietary java, open sourced icedtea fork is made of two components:
JRE – Java Runtime Environment
and
JDK – Java Development Kit).
1. installing OpenJDK Open Source Java Virtual Machine on Debian GNU / Linux
The default meta-package for install java-jre is default-jre meta package which by default on Debian Wheezy points to openjdk:
apt-cache depends default-jdk
default-jdk
Depends: default-jre
Depends: openjdk-6-jdk
If you want to install default Open Source Java Debian package implementation run:
apt-get –yes install default-jre
…
apt-get –yes install default-jdk
…
2. Installing Oracle Java VM 7 on Debian / Ubuntu Linux and deb derivatives
Also it is possible to install Oracle Java 7 from binary via apt-get by adding a custom Ubuntu repository containing deb Oracle proprietary java install package called oracle-java7-installer:
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys EEA14886
apt-get update
apt-get install –yes oracle-java7-installer
Above apt-get command can be used also to install Oracle Sun Java on Ubuntu Linux and other Debian derivatives, for example you can install it like this on Linux Mint and rest of deb based Desktop oriented Linuces …
If you already have the openjdk installed together with oracle java jdk, to make oracle jdk the default Virtual Machine install also oracle-java7-set-default:
apt-get install oracle-java7-set-default
3. Installing Oracle Java 8 the debian way on Debian and Ubuntu Linux
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv –keyserver keyserver.ubuntu.com –recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer
4. Install Oracle Proprietary Java on Debian Linux using any version from Oracle website
As some written software requires custom ex-SUN Microsystems and currently owned by Oracle Java proprietary non-free binaries to install them on Debian Linux 7, there is a way to download any sun java jdk version, create .deb package and install the package with dpkg.
Here is how:
a.) Install java-package meta-package
apt-get –yes install java-package
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
autopoint debhelper gettext git git-man html2text intltool-debian liberror-perl libgettextpo0 libmail-sendmail-perl libsys-hostname-long-perl po-debconf rsync
Suggested packages:
dh-make gettext-doc git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn git-email git-gui gitk gitweb libmail-box-perl
The following NEW packages will be installed:
autopoint debhelper gettext git git-man html2text intltool-debian java-package liberror-perl libgettextpo0 libmail-sendmail-perl libsys-hostname-long-perl po-debconf rsync
0 upgraded, 14 newly installed, 0 to remove and 112 not upgraded.
Need to get 11.8 MB of archives.
After this operation, 24.7 MB of additional disk space will be used.
b.) Download your desiresd Oracle Java version
Then according to your Debian Linux platform install (32-bit x86 or 64-bit amd64) go in a browser to:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Accept the agreement and download latest Java release, if you need to install some specific Oracle Java version check out there Old Java download versions (archives) page
Note that in order to download, either you will need some text-browser like elinks or you will need to have a GUI environment with IceWeasel / Epiphany etc. If you're already using the Linux as a desktop environment with GNOME and you used IceWeasel to download java jdk it will be downloaded into /tmp
cd /tmp
make-jpkg <downloaded_jdk_file>
Install the binary package created:
dpkg -i oracle-j2sdk1.7_1.7.0+update44_amd64.deb
Enjoy 🙂