javaws script is broken for some invocations

Bug #211515 reported by Paul Smith
2
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-6-jre-headless 6b08-0ubuntu1 OpenJDK Java runtime (headless)
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/bin/javaws.real: not found

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/jvm/java-6-openjdk/bin/javaws -viewer /tmp/javaRKVM-4.jnlp
+ prog=/usr/lib/jvm/java-6-openjdk/bin/javaws
+ [ -h /usr/lib/jvm/java-6-openjdk/bin/javaws ]
+ readlink /usr/lib/jvm/java-6-openjdk/bin/javaws
+ prog=../jre/bin/javaws
+ [ -h ../jre/bin/javaws ]
+ [ 2 -eq 0 ]
+ dirname ../jre/bin/javaws
+ exec ../jre/bin/javaws.real -viewer /tmp/javaRKVM-4.jnlp
exec: 1: ../jre/bin/javaws.real: not found

But, if I run this as /usr/bin/javaws I get this:

+ : /usr/bin/javaws
+ prog=/usr/bin/javaws
+ [ -h /usr/bin/javaws ]
+ readlink /usr/bin/javaws
+ prog=/etc/alternatives/javaws
+ [ -h /etc/alternatives/javaws ]
+ readlink /etc/alternatives/javaws
+ prog=/usr/lib/jvm/java-6-openjdk/jre/bin/javaws
+ [ -h /usr/lib/jvm/java-6-openjdk/jre/bin/javaws ]
+ [ 0 -eq 0 ]
+ set -- -viewer
+ dirname /usr/lib/jvm/java-6-openjdk/jre/bin/javaws
+ exec /usr/lib/jvm/java-6-openjdk/jre/bin/javaws.real -viewer

It appears that this loop to resolve symbolic links cannot handle relative pathnames, like this:

$ ls -al /usr/lib/jvm/java-6-openjdk/bin/javaws
lrwxrwxrwx 1 root root 17 Mar 31 17:29 /usr/lib/jvm/java-6-openjdk/bin/javaws -> ../jre/bin/javaws

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/jvm/java-6-openjdk/bin/javaws. Actually, the right answer is the former.

Related branches

Revision history for this message
Paul Smith (psmith-gnu) wrote :

Here's a patch that fixes the problem.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openjdk-6 - 6b08-0ubuntu4

---------------
openjdk-6 (6b08-0ubuntu4) hardy; urgency=low

  * Update IcedTea build infrastructure.
    - Fix build failure on ia64.
  * javaws-wrapper.sh: Use readlink --canonicalize. LP: #211515.

 -- Matthias Klose <email address hidden> Mon, 07 Apr 2008 15:56:08 +0000

Changed in openjdk-6:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.