Default Java paths aren't set up by default

Bug #518948 reported by Soren Hauberg
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openjdk-6 (Ubuntu)
Invalid
Undecided
Unassigned
sun-java6 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I did not file this bug against a package as it seems to be more like an infra-structure problem.

If I install the Sun Java Developer Kit ('sun-java6-jdk') it gets installed in '/usr/lib/jvm/java-6-sun'. Most 3rd party applications look for this in '/usr/lib/jvm/default-java'. The standard solution is to create a symbolic link from '/usr/lib/jvm/java-6-sun' to '/usr/lib/jvm/default-java'. This is, however, not done automatically unless I install the 'default-jdk' package which installs the 'openjdk-6-jdk' package. So, if I only want the Sun JDK I have to manually create the symlink. This link does not seem to be create by 'sudo update-java-alternatives -s java-6-sun' unless I install the 'default-jdk' package.

Okay, this description was a bit convoluted, but the problem itself seems to be rather convoluted. I would have expected the following behavior:

  * When I install _any_ JDK the corresponding '/usr/lib/jvm/default-java' if it does not already exist.

  * When I run 'sudo update-java-alternatives -s java-6-sun' I would expect '/usr/lib/jvm/default-java' to be created even if I don't have the 'default-jdk' package installed.

Revision history for this message
Gabe Gorelick (gabegorelick) wrote :

This isn't really an "infrastructure" bug as you put it. Rather it is a bug with a specific package not installing a file where it should.

affects: ubuntu → sun-java6 (Ubuntu)
Revision history for this message
Soren Hauberg (hauberg) wrote :

Okay, I called it an "infrastructure" bug as the same issue is affecting both Sun JDK and the OpenJDK packages.

Revision history for this message
Gabe Gorelick (gabegorelick) wrote :

Oh. I misread your original description to mean that only sun-java had this problem. I think I understand what you're saying now. You mean that if you just install sun-java and/or openjdk, then there is no default-java symlink. This symlink only gets created if you install the default-jdk package (which installs openjdk). Is that a correct assessment of this?

Revision history for this message
Soren Hauberg (hauberg) wrote :

Yes that is correct. I apologise for not being more clear in my report.

Revision history for this message
Gabe Gorelick (gabegorelick) wrote :

That's ok. Like you said, this is a convoluted issue.

Revision history for this message
Gabe Gorelick (gabegorelick) wrote :

Subscribing the java packaging team as this seems to be there domain.

Revision history for this message
Thierry Carrez (ttx) wrote :

I think there is a bit of misunderstanding here.

"default-java" is not an alternative that can be served by any JDK/JVM (like the "java" command). It points to the default implementation of Java for your platform. In Ubuntu on amd64 and i386, the default Java stack is OpenJDK. It's an indirection that, amongst other things, helps migrating to a new default Java (OpenJDK-7 ?) when available.

So third-party applications that point to "default-java" do explicitly ask to use OpenJDK and not Sun's JDK. They should be changed to allow for a less strict dependency. Tomcat, for example, looks in its init script for JVMs in a list of potential paths, and allows you to change (in its /etc/defaults file) which one should be used.

Closing as Invalid for the JDKs, feel free to open tasks against the "third-party apps".

Changed in sun-java6 (Ubuntu):
status: New → Invalid
Changed in openjdk-6 (Ubuntu):
status: New → Invalid
Revision history for this message
Soren Hauberg (hauberg) wrote : Re: [Bug 518948] Re: Default Java paths aren't set up by default

ons, 10 02 2010 kl. 08:13 +0000, skrev Thierry Carrez:
> I think there is a bit of misunderstanding here.

Okay, I see (definitely not the behaviour I would have expected,
though).

Is it also on purpose that 'sudo update-java-alternatives -s java-6-sun'
does _not_ create the link '/usr/lib/jvm/default-java' unless
'default-jdk' happens to be installed?

Søren

Revision history for this message
Thierry Carrez (ttx) wrote :

Yes, "default-jdk" just installs a link from /usr/lib/jvm/default-java to openJDK6.

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.