josm does not always find a valid JVM

Bug #916948 reported by Paul Sladen
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
josm (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Doing:

  apt-get install josm

under precise installs lots of java packages, but not a package with the actual 'java' command that '/usr/bin/josm' runs.

Ideally 'default-jre' or equivalent to be added to the dependency somehow.

Tags: patch precise
Changed in josm (Ubuntu):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Revision history for this message
Colin Watson (cjwatson) wrote :

I don't get it:

  Depends: openjdk-6-jre | sun-java6-jre | openjdk-7-jre

That's not "default-jre", admittedly, but all default-jre effectively does is depend on openjdk-6-jre. Do you have any of the above-listed packages installed? If so, which?

Changed in josm (Ubuntu):
status: New → Incomplete
Revision history for this message
Tobias Johansson (tj-mensa) wrote :

I think I have the same bug. But I'm not sure. I just upgraded to 12.04 lts and after that I couldn't start josm from the unity launcher anymore.
So I did/found the following
1. Started command_promt typed "josm" and got "No valid JVM found to run JOSM."
2. Checked for packages "openjdk-6-jre | sun-java6-jre | openjdk-7-jre" in programcentral and found that "openjdk-6-jre" was installed
3. searched machine for josm.jar and found it "/usr/share/josm/josm.jar"
4. tried command "java -jar /usr/share/josm/josm.jar" and josm started no problem.
5. checked the script "/usr/bin/josm" that is used to start josm. the line that gives javacommands (I think not any godd with scripts) says "JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-6-openjdk/bin/java /usr/lib/jvm/java-6-sun/bin/java" " but the location of java command in my system seems to be "/usr/lib/jvm/java-6-openjdk-i386/jre/bin/java" thus the script returns that no JVM is found.
6. Changed this line to "JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-6-openjdk/bin/java /usr/lib/jvm/java-6-sun/bin/java /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java" "
7. Tried to launch from unity menu and it worked :)

So I thinck that the problem is the script not that the JVM isn't installed?

Revision history for this message
Stefan Tauner (stefanct) wrote :

after installing openjdk-7-jdk
and removing the following packages:
default-jdk openjdk-6-jre-headless default-jre-headless icedtea-6-jre-jamvm openjdk-6-jre openjdk-6-jre-lib icedtea-6-jre-cacao openjdk-6-jdk default-jre openjdk-6-demo

the josm start script failed to load it as described above although
java -jar /usr/share/josm/josm.jar
works fine...

summary: - Does not default on java runtime (eg. default-jre)
+ josm does not always find a valid JVM
Changed in josm (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Stefan Tauner (stefanct) wrote :

i have not looked at how debian does this (we probably better should do that), but FWIW this is my solution... this most probably is not what the original authors wanted though, because this will try to launch josm even on headless-only solutions i think. but it has the advantage, that it uses whatever jvm is available, even if it is only reachable by JAVA_HOME and/or JDK_HOME...

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "josm-JAVA_HOME.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
tags: added: precise
Changed in josm (Ubuntu):
assignee: Canonical Foundations Team (canonical-foundations) → nobody
importance: Undecided → Medium
Revision history for this message
Alexandre Magno (alexandre-mbm) wrote :

See the bug #1186377.

Revision history for this message
Bas Couwenberg (sebastic) wrote :

The /usr/bin/josm used by the upstream packages for their PPA [0] and the one used for the Debian package included in Debian and derivatives have been synchronized with the update to JOSM 8989. [1]

Both OpenJDK & the Oracle JDK packages for Ubuntu are now supported in /usr/bin/josm, if you need josm to use a different JDK it has been possible to specific it with the JAVACMD environment variable for quite some time, e.g.:

 JAVACMD=/usr/lib/jvm/jdk-8-oracle-x64/bin/java josm

If the /usr/bin/java configured with the alternatives system is found in the list of possible java commands that one will be used, if it's not found the first java command that exists and is executable will be used. The list of possible java commands is not checked when JAVACMD was already defined in the environment.

[0] https://josm.openstreetmap.de/wiki/Download#Ubuntu
[1] https://josm.openstreetmap.de/ticket/12033

Changed in josm (Ubuntu):
status: Confirmed → 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.