On my current Debian Wheezy workstation, it looks as though Java 6 was installed by default:
sadmin@guest1:~$ java -version java version "1.6.0_27" OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1~deb7u1) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
However, when trying to install the latest version of NetBeans with the C++ development tools, it is asking for version 7 runtime.
NOTE: read to the end of this blog entry for the correct way of doing things. It took me a convoluted mechanism to find the correct actual Debian package.
While looking more at this, in the past, I had been working with the Java Runtime Environment (JRE). But now it appears as though Debian has licensing issues with how Java is released. Based upon some reading, The JDK (Java Development Kit), which includes the JRE) has a different licensing scheme than does the JRE when released alone. Therefore it appears as though the JDK is installed, even though I think it is a larger install than just the JRE.
But being contrarian, I wanted just the JRE. So, after downloading the JRE7 from www.java.com, and expanding it out, and moving the directory to /usr/local, I did the following:
# update-alternatives --install /usr/bin/java java /usr/local/jre1.7.0_45/bin/java 1 # update-alternatives --config java
The caveat with this is that it doesn't deal with versions as used by browsers are for development. Other blogs, which go into deeper but possibly obsolete detail, but using the jdk as the unit of installation:
- http://www.redirecttonull.com/?p=250K
- LinuxQuestions.org
- The Worst Website
- installing oracle java 7 jre/jdk on debian wheezy
- Why there is no sun-java in Debian Wheezy and how can I fix this?
In hindsight, after looking at some more packages in Debian, I might have been able to install the openjdk-7-jre package. The package details discuss Hotspot JIT< (Just in Time???), IcedTea, etrc. What the heck are those? IcedTea may have something to do with browser support.
I went ahead and installed that package. Knowing about that ahead of time may have shortened the search. Perhaps the Debian JRE Wiki page might be updated to reflect what could be done, rather than stating what can't be done: "The Java 2 Runtime Environment can NOT be distributed as part of Debian".
Now that I look at it again, Debian Java Wiki has a better answer where it does mention that package explicitly.