Oracle Java
Contents |
Goodbye Oracle-Java
Oracle is retiring the "Operating System Distributor License" for Java (DLJ), which means Linux distributions will no longer make Oracle-Java available as native packages as described here.
Oracle will now offer Java 7 under their Binary Code License (BCL), and you can download Oracle-Java from them directly, but will not be able to install it via your distros package manager directly.
Furthermore, due to the change in licensing it may be difficult (impossible) to find the BCL version in 3rd party, ppl, partner, or other repositories as the BCL does not allow for redistribution - that was the purpose served by the DLJ license.
OpenJDK to be the Gold Standard
Oracle is moving to OpenJDK as their official reference implementation. Theoretically, this should mean that OpenJDK 7 (as the RI) would be 100% compatible with what was previously "Sun Java".
Using OpenJDK 7 as the reference implementation should bring OpenJDK into being the "just works" implementation which sun-java previously enjoyed, while at the same time being GPL.
(My less-then-optimistic opinion of Oracle can not help but wonder if this will, in fact, all play out quite that smoothly. Of course, IcedTea is supposed to be compatible with Oracle Java 6, yet I continue to observe numerous instances where this is not the case. Having OpenJDK be the reference implementation, and GPL, could be great. But it is Oracle after all.)
References on Licenses & Moving to OpenJDK 7
http://news.ycombinator.com/item?id=2933809
http://techie-buzz.com/foss/oracle-jdk-license-change.html/print
http://robilad.livejournal.com/90792.html
http://blogs.oracle.com/henrik/entry/moving_to_openjdk_as_the
Availability of OpenJDK 7
OpenJDK 7 is not readily available for the current versions of many distributions. Of course, as new versions come out, they will include OpenJDK 7.
If you wish to use the new version of Java now, you may either install the Oracle version, or find a packaged version of OpenJDK 7 which you may be able to use for your distro.
Below, I show using both methods to set up both Oracle and OpenJDK 7 on OpenSuse 11.4, for which there are no official Suse Packages available at this time.
Installing OpenJDK 7
For early testing purposes, you can install Java 7 by either shoehorning an OpenJDK package you can find, or by using the Oracle release. Examples of each follow.
I like using update-alternatives for selecting multiple Java instances, though this may need tweaked for your environment.
Install OpenJDK7 using Fedora (Rawhide) build
(Does not include IcedTea, which must be installed separately.)
This needs glibc 2.14. For Suse 11.4 this is in Factory. For other distros, your mileage will vary. If you don't want to update glibc, you might want to just use the Oracle BCL version (below) until a your distro is updated.
wget http://download.fedora.redhat.com/pub/fedora/linux/development/rawhide/x86_64/os/Packages/java-1.7.0-openjdk-1.7.0.0-0.1.20110803.fc17.x86_64.rpm ln -s /usr/sbin/update-alternatives /usr/sbin/alternatives (Fedora uses alternatives rather than update-alternatives. For OpenSuse, create a symlink prior to installing so that alternatives entries are properly created.) rpm -ivh --nodeps java-1.7.0-openjdk-1.7.0.0-0.1.20110803.fc17.x86_64.rpm update-alternatives --list java update-alternatives --config java java -version If it was not added correctly, you may need to manually add it: update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java" 50
(Note: The above openjdk does not include the browser plugin, which is available here)
Install Oracle's OpenJDK7 BCL version
Download JDK or JRE from here
Java: rpm -ivh jre-7-linux-x64.rpm update-alternatives --install "/usr/bin/java" "java" "/usr/java/jre1.7.0/bin/java" 40 update-alternatives --config java java -version Configure browser plugin: update-alternatives --install /usr/lib64/browser-plugins/javaplugin.so javaplugin /usr/java/jre1.7.0/lib/amd64/libnpjp2.so 50 (Change amd64 to i386 if 32-bit Java was installed. For Ubuntu, the first path might be something like /usr/lib64/mozilla/plugins/mozilla-javaplugin.so) update-alternatives --config javaplugin Restart Firefox, verify with about:plugins Configure Java Web Start: update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/java/jre1.7.0/bin/javaws" 50 update-alternatives --config javaws
Browser Plugin
Oracle instructions on manually configuring the browser plugin are here
Your distro might put the browser plugin, or a symlink to it, in any of these places
~/moilla/plugins /usr/share/mozilla/extensions/
In Suse 12.1 it is:
Calculus:~ # ls -ld /usr/lib64/browser-plugins/javaplugin.so lrwxrwxrwx 1 root root 28 Jan 28 17:26 /usr/lib64/browser-plugins/javaplugin.so -> /etc/alternatives/javaplugin Calculus:~ # ls -ld /etc/alternatives/javaplugin lrwxrwxrwx 1 root root 61 Jan 28 17:26 /etc/alternatives/javaplugin -> /usr/lib64/jvm/java-1.7.0-sun-1.7.0/jre/lib/amd64/libnpjp2.so
After you have the plugin / symlinks set, then specify to use javaws rather than icedtea when Firefox prompts for the application to use to start an JNLP file. If you simply use /etc/alternatives/javaplugin then if you switch between OpenJDK / Sun with update-alternative -config javaws, it will use icedtea / javaws for JNLP.
http://java.com/en/download/installed.jsp?detect=jre&try=1
Handy Sites
http://sites.google.com/site/easylinuxtipsproject/java-for-opensuse
http://download.fedora.redhat.com/pub/fedora/linux/development/rawhide/x86_64/os/Packages/
http://www.tolaris.com/2010/06/10/installing-sun-java-on-ubuntu-lucid/