javaws script is broken for some invocations
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openjdk-6 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: openjdk-6-jre
I'm running on an up-to-date Hardy Heron Beta release:
$ dpkg -l openjdk\*
ii openjdk-6-jre 6b08-0ubuntu1 OpenJDK Java runtime
ii openjdk-
ii openjdk-6-jre-lib 6b08-0ubuntu1 OpenJDK Java runtime (architecture independent libraries)
I try to open a java-based console for embedded hardware. I click the button in FireFox and I get a query as to what application I want to use to open it (the filename is javaRKVM.jnlp) The default (and only) option in FireFox is "OpenJDK Java Web Start (default)".
I say OK.
Nothing happens.
Looking at my ~/.xsession-errors file I see this line:
exec: 1: ../jre/
Aha! Says I. But, if I run /usr/bin/javaws it works. So I edited that shell script and forced it to print its invocation information and run with shell debugging (-x). Now when I do this I see this in my ~/.xsession-errors file:
+ : /usr/lib/
+ prog=/usr/
+ [ -h /usr/lib/
+ readlink /usr/lib/
+ prog=..
+ [ -h ../jre/bin/javaws ]
+ [ 2 -eq 0 ]
+ dirname ../jre/bin/javaws
+ exec ../jre/
exec: 1: ../jre/
But, if I run this as /usr/bin/javaws I get this:
+ : /usr/bin/javaws
+ prog=/usr/
+ [ -h /usr/bin/javaws ]
+ readlink /usr/bin/javaws
+ prog=/etc/
+ [ -h /etc/alternativ
+ readlink /etc/alternativ
+ prog=/usr/
+ [ -h /usr/lib/
+ [ 0 -eq 0 ]
+ set -- -viewer
+ dirname /usr/lib/
+ exec /usr/lib/
It appears that this loop to resolve symbolic links cannot handle relative pathnames, like this:
$ ls -al /usr/lib/
lrwxrwxrwx 1 root root 17 Mar 31 17:29 /usr/lib/
So either the script needs to be rewritten to be smarter, or the FireFox plugin needs to run /usr/bin/javaws instead of /usr/lib/
Here's a patch that fixes the problem.