Between Oracle and the various GNU/Linux distributions the damn Java ball has been dropped!
Really unprofessional from both sides, I don’t care for the technicalities, both sides screwed up and your users are suffering.
Basically along with Oracle’s security update 29 the terms that allow Linux distributions to distribute the Sun JRE and JDK have been removed. This required Debian/Ubuntu/Mint to remove the package as per this bug report.
So what the hell are our Java options for production servers?
Turns out that the only real solution at the moment is to manually download and install the JRE / JDK from Oracle. Which may be exactly what Oracle wants but for production software there really is no other option:
- Production servers must be security patched.
- We can’t hope that production code will work 100% on openJDK.
- OpenJDK-6 is in Debian Squeeze, but openJDK-7 was not.
- IntelliJ IDEA does not support openJDK.
- It would be madness to develop on one JDK and deploy on another at this stage.
Further Oracle’s license terms are not fun and include a ‘call home’ function…grumble…
Anyway until this mess is corrected by the parties involved download the Oracle JDK:
Register for email security update notifications:
Follow this Debian/Ubuntu how to:
My JDK install steps:
- Install openjdk-7-jre OR openjdk-7-jre-headless to keep Debian package dependencies happy.
- Remove all sun-java6-* packages (BIG security holes remember...)
- Ensure that any browser plug-in's are removed (icedtea-plugin, sun-java6-plugin).
- For 32bit OR for 64bit:
- mkdir -p /usr/local/bin/java/32 OR mkdir -p /usr/local/bin/java/64
- cd /usr/local/bin/java/32 OR cd /usr/local/bin/java/64
- Download: wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7uXX-bXX/jdk-7uXX-linux-yyy.tar.gz"
- tar zxvf jdk-7uXX-linux-yyy.tar.gz
- ln -s /usr/local/bin/java/32/jdk1.7.0_XX /usr/local/bin/oracle-java-default OR ln -s /usr/local/bin/java/64/jdk1.7.0_XX /usr/local/bin/oracle-java-default
- update-alternatives --install "/usr/bin/java" "java" "/usr/local/bin/oracle-java-default/bin/java" 1
- update-alternatives --set java "/usr/local/bin/oracle-java-default/bin/java"
Further for Android development:
- update-alternatives --install "/usr/bin/keytool" "keytool" "/usr/local/bin/oracle-java-default/bin/keytool" 1
- update-alternatives --set keytool "/usr/local/bin/oracle-java-default/bin/keytool"
- update-alternatives --get-selections | grep java
Note: that we can now use our /usr/local/bin/oracle-java-default symlink in all further setup.
Note: that XX must be replaced by the latest version and yyy must be replaced by x64 or i586 in the above steps.
To install browser plugin for each user:
- In Iceweasel/Firefox Tools -> Add-ons -> Plugins -> Disable Java Plugin.
- Copy the three commands below, shut browser down.
- mkdir ~/.mozilla/plugins
- rm ~/.mozilla/plugins/libnpjp2.so
- ln -s /usr/local/bin/oracle-java-default/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/ OR ln -s /usr/local/bin/oracle-java-default/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
- Start browser and check that Add-ons shows correct Java Plugin version.
To setup Tomcat:
- Edit: nano /etc/environment
- Set: JAVA_HOME=/usr/local/bin/oracle-java-default
- Edit: nano /etc/default/tomcat6
- Set: JAVA_HOME=/usr/local/bin/oracle-java-default
To upgrade Java version using our symlink:
- cd /usr/local/bin/java/32/ OR cd /usr/local/bin/java/64
- Download (see wget command above), extract: tar zxvf jdk-7uXX-linux-yyy.tar.gz
- rm /usr/local/bin/oracle-java-default
- ln -s /usr/local/bin/java/32/jdk1.7.0_XX /usr/local/bin/oracle-java-default OR ln -s /usr/local/bin/java/64/jdk1.7.0_XX /usr/local/bin/oracle-java-default
To check Java versions:
$ java -version
visit http://java.com/en/download/installed.jsp
UPDATE note on Java 6:
Java 6 (6u45-b06) is listed as an archive historical version on Oracle.com
The wget link will not work exactly as posted above.
To download an oracle.com account is required.
Oracle Java Archive
I guess any future framework need will be filled by Yii for me. Grails is awesome, but Oracle has come to kill the party.
Or back to Python :-O I have had a few people tell me it’s pretty good for web development now. Na stuff it just use Javascript from front to back!
hmmmmm, Just straight C using cgi. Yep, that’s the winner, not going to change any time soon.
๐
Webupd8 provides a repo now so you get the updates automatically.
It’s a PPA in Ubuntu, so super easy, but for Debian it’s still very straight forward, just use the traditional edit of sources, update and install.
I’ve been using it for ages now, mainly for minecraft servers ๐
http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html