Task #8004 (closed)
Opened 12 years ago
Closed 12 years ago
Ubuntu 11 Oneiric jdk docs
Reported by: | wmoore | Owned by: | szwells |
---|---|---|---|
Priority: | major | Milestone: | OMERO-4.4 |
Component: | Documentation | Version: | n.a. |
Keywords: | n.a. | Cc: | cxallan, jamoore, ckm |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | 2012-02-28 (9) |
Description
Was just trying to follow the Debian install docs on my Ubuntu Oneiric 11.
Struggled to get jdk with the existing docs, made some progress with instructions here http://superuser.com/questions/355453/how-can-i-install-sun-java6-sdk-on-ubuntu-11-oneiric
will@will-netbook:~/openmicroscopy$ echo $JAVA_HOME /usr/lib/jvm/java-1.6.0-openjdk
but still failed to build server:
/home/will/openmicroscopy/components/insight/build.xml:38: The following error occurred while executing this line: /home/will/openmicroscopy/components/insight/build/app.xml:138: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "/usr/lib/jvm/java-6-openjdk/jre" Total time: 16 minutes 1 second will@will-netbook:~/openmicroscopy$
Change History (12)
comment:1 Changed 12 years ago by jmoore
- Cc cxallan jmoore added
comment:2 Changed 12 years ago by szwells
- Remaining Time set to 1
- Status changed from new to accepted
comment:3 Changed 12 years ago by szwells
So the problem is caused by Oracle Java being removed from Debian & Ubuntu repositories as a result of Oracle withdrawing the OSD License for Java. This means that Java can no longer be distributed by OS vendors. Oracle still distributes compiled binaries from http://www.oracle.com/technetwork/java/javase/downloads/index.html in the form of an RPM (which doesn't work with alien) and a tarball however there are no install scripts to place the various tools in the correct locations on the OS & to set up the necessary symlinks. This means that installing Java is no longer a simple matter of:
$ apt-get install sun-java6-jdk
Apparently, as of Feb. 16th, Ubuntu 10.04, 11.04, & 11.10, will no longer have the sun/oracle JDK available at all in the repos. There are several approaches that can be taken to install the jdk in Debian based systems:
- Using a third-party PPA. I have tested this approach and it works for now but with caveats. This is straightforward but fragile in the longer term because Canonical has disabled some third-party PPAs due to the potential for copyright infringements due to the lack of OSDL (see: http://blog.flexion.org/2012/01/10/updated-sun-java6-packages-for-ubuntu/ for more on this). Using a PPA works as follows, e.g.
$ sudo apt-get install python-software-properties $ sudo add-apt-repository ppa:ferramroberto/java $ sudo apt-get update $ sudo apt-get install sun-java6-jdk
- An alternative is to build a local apt repo using the scripts from: https://github.com/flexiondotorg/oab-java6 (for Ubuntu) and https://github.com/rraptorr/sun-java6 (for Debian). I will test this approach before updating our documentation with new instructions.
comment:4 Changed 12 years ago by szwells
Will, you might want to try the above. If you have the openJDK installed then you might also need to do either:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
to completely remove the OpenJDK or:
sudo update-alternatives --config java
to ensure that the Oracle Java is activated
comment:5 Changed 12 years ago by szwells
Have now tested the oab-java6 script from https://github.com/flexiondotorg/oab-java6
Installing Java on Ubuntu 11.10 with this is as simple as:
$ sudo apt-get install git $ git clone https://github.com/flexiondotorg/oab-java6.git $ cd oab-java6/ $ sudo ./oab-java6.sh $ sudo apt-get install sun-java6-jdk
Unless there are any objections I will add this to our instructions for installing the Java 6 JDK on Ubuntu. For future proofness we could also consider forking the script (MIT license) and including in our Linux install folder.
comment:6 Changed 12 years ago by jmoore
- Cc ckm added
Stick, can you take a look at this after the fun you had on redhat and give any opinions?
comment:7 Changed 12 years ago by cmacleod-x
The Red Hat situation is similar, repackage jpackage.org rpms or consume the oracle rpms directly. RPMs from sun/oracle are likely to be slightly better now than in the past since they would advocate and maintain them for OEL, but it would need to be tested. They do not offer deb's only binaries so that still leaves ppa's to maintain a packaged solution. Further explanation is here http://sylvestre.ledru.info/blog/sylvestre/2011/08/26/sun_java6_packages_removed_from_debian_u. It pretty much boils down to OpenJDK is the reference implementation for distributions moving forward and the only ones they can distribute (based on licenses), however openjdk doesn't seem to be as mature in certain areas (and flat out doesn't work in places).
comment:8 Changed 12 years ago by szwells
I have now tested out the script from https://github.com/rraptorr/sun-java6 which packages up debs using the official Oracle tarballs. Installation is then a matter of:
$ dpkg -i *.deb $ apt-get -f install
This works fine on Debian (& I assume will work fine on Ubuntu - I will test this). The upshot is that we can build & install deb packages for Debian & Ubuntu locally.
To address Stick's comment re: PPAs; I believe that the lack of the ODSL license means that we cannot rely on PPAs for installation. There have already been occurrences of Ubuntu removing third party java install PPAs and we don't want to be in the position of having to commit resources to chase down new & updated ones periodically to ensure that our documentation is accurate & effective.
By giving our users clear instructions for how to build deb packages locally, we can have a (fairly) simple & robust installation process for Java that doesn't rely on PPAs & possible contributory copyright infringement.
So, my vote is for building the debs locally on the user machine and giving clear instructions for doing so. There are working scripts that do this which are under GPL compatible licenses so we can include them in our repo with the installation docs.
The alternatives are
- PPA
- Let the user sort it out for themselves
Anybody have any other alternative positions? I am willing to go with the consensus on this one...
comment:9 Changed 12 years ago by jmoore
Simon, what are the added build requirements for the packages? i.e how burdensome will this be for our users?
comment:10 Changed 12 years ago by szwells
Josh, the commands given in comment 5 are indicative of the burden placed on our users to install Java this way from a base OS install. These commands could be reduced further depending upon how we recommend that the user retrieves the install script, e.g. download from website, wget\curl from git repo, etc. essentially it is a couple of commands, e.g. (1) run the build script, (2) apt-get install
NB. I have tested the oab-java6 script and it works on both Ubuntu & Debian (if lsb_release is installed).
comment:11 Changed 12 years ago by szwells
The original issue that Will reported has been fixed via a workaround & the docs updated to reflect this. We need to wait now until a more stable situation arises vis-a-vis the Oracle JDK and Debian-Ubuntu distribution licensing if we are to continue targeting the Oracle JDK or more to targetting the OpenJDK. As a result, closing this ticket as fixed.
comment:12 Changed 12 years ago by szwells
- Remaining Time changed from 1 to 0
- Resolution set to fixed
- Sprint set to 2012-02-28 (9)
- Status changed from accepted to closed
Will, when you set JAVA_HOME did you also export it? e.g. JAVA_HOME=...; export JAVA_HOME That might explain the build issue.
But note that openjdk isn't supported.