josm fails to start "No valid JVM found to run JOSM." due to lack of $JAVA_HOME on Ubuntu

Bug #1186377 reported by Chris Bainbridge
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
josm (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

In Ubuntu 12.04.2 with openjdk-7-jre installed:

$ josm
No valid JVM found to run JOSM.

This happens because /usr/bin/josm prefixes the java command with $JAVA_HOME but on Ubuntu JAVA_HOME is not set.

The following works

$ JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 josm

Obviously the josm start script should not be depending on an environment variable that Ubuntu does not set.

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in josm (Ubuntu):
status: New → Confirmed
Revision history for this message
Gromobir (gromobir) wrote :

Thank you very much for posting the solution here.
Trisquel, which is based on Ubuntu, is still affected by this bug.

Revision history for this message
Alexandre Magno (alexandre-mbm) wrote :

https://josm.openstreetmap.de/ticket/8279 ‒ this works for me!

Edit the line 16 at /usr/bin/josm:
JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java"

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

Since josm (0.0.svn8969+dfsg-1) java-7-oracle (and its Java 8 & 9 alternatives) are included in the list of possible java commands.

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 specify it with the JAVACMD environment variable for quite some time, e.g. for the JDK package built by make-jpkg:

 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.