Public bug reported: ImageJ fails to run on an amd64 system if ia32-sun-java6-bin is installed. It fails with the error message > Running a 64-bit JVM is not supported on this platform. This seems to be due to the script /usr/bin/imagej setting JAVA_HOME by JAVA_HOME=$(/usr/sbin/update-java-alternatives -l java-6-openjdk | head -1 | cut -d' ' -f 3) i.e. the top line returned from 'update-java-alternatives -l'. This happens to be ia32-java-6-sun, even though /etc/alternatives/java points to /usr/lib/jvm/java-6-openjdk/jre/bin/java. The script then finds out using 'uname -m' that it is a 64 bit architecture, and therefore passes '-d64' to java. This would work on a 64 bit jvm, but not on the 32 bit jvm chosen by the script.
I guess update-java-alternatives is not the correct way to determine the default java home. I don't know the correct approach, but this seems to work for me: JAVA_HOME=$(dirname $(dirname $(dirname $(readlink /etc/alternatives/java)))) Also, I guess the script strictly should make sure it's a 64 bit jvm instead of just using 'uname -m' ** Affects: imagej (Ubuntu) Importance: Undecided Status: New -- ImageJ chooses wrong java home https://bugs.launchpad.net/bugs/294753 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs