Modify

Opened 2 years ago

Closed 2 years ago

#10099 closed defect (fixed)

JOSM tries to use Java 6 when installed

Reported by: shoorick Owned by: bastiK
Priority: normal Milestone: 14.06
Component: Ubuntu package Version: tested
Keywords: Cc:

Description

JOSM stops when Java 6 installed even Java 7 presented too. Checked under Ubuntu 12.04 LTS with simultaneously installed Java 6 and 7. JOSM which spawned from terminal produce error:

Using /usr/lib/jvm/java-6-openjdk-i386/bin/java to execute josm.
Exception in thread "main" java.lang.UnsupportedClassVersionError: JOSM : Unsupported major.minor version 51.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: JOSM. Program will exit.

How to resolve

Remove paths to Java 6 from /usr/bin/josm:

  • josm

    old new  
    1111
    1212# If OpenJDK is only available headless, do not try it
    1313if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ; then
    14         JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-6-openjdk/bin/java /usr/lib/jvm/java-6-openjdk-$ARCH/bin/java /usr/lib/jvm/java-6-sun/bin/java"
     14        JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java"
    1515else
    16         JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-6-sun/bin/java /usr/bin/java"
     16        JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java"
    1717fi
    1818
    1919JAVA_OPTS="-Djosm.restart=true -Djava.net.useSystemProxies=true $JAVA_OPTS"

Attachments (0)

Change History (5)

comment:1 Changed 2 years ago by Don-vip

  • Milestone set to 14.06

comment:2 Changed 2 years ago by skyper

See also #8700.

comment:3 Changed 2 years ago by bastiK

  • Resolution set to fixed
  • Status changed from new to closed

The following changes have been applied (for next release):

  • tested/usr/bin/josm

     
    1111
    1212# If OpenJDK is only available headless, do not try it
    1313if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ; then
    14         JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-6-openjdk/bin/java /usr/lib/jvm/java-6-openjdk-$ARCH/bin/java /usr/lib/jvm/java-6-sun/bin/java"
     14        JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java"
    1515else
    16         JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-6-sun/bin/java /usr/bin/java"
     16        JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java"
    1717fi
    1818
    1919JAVA_OPTS="-Djosm.restart=true -Djava.net.useSystemProxies=true $JAVA_OPTS"
  • latest/usr/bin/josm-latest

     
    1111
    1212# If OpenJDK is only available headless, do not try it
    1313if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ; then
    14         JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-6-openjdk/bin/java /usr/lib/jvm/java-6-openjdk-$ARCH/bin/java /usr/lib/jvm/java-6-sun/bin/java"
     14        JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java"
    1515else
    16         JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-6-sun/bin/java /usr/bin/java"
     16        JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java"
    1717fi
    1818
    1919JAVA_OPTS="-Djosm.restart=true -Djosm.home=$HOME/.josm-latest -Djava.net.useSystemProxies=true $JAVA_OPTS"

comment:4 Changed 2 years ago by skyper

  • Resolution fixed deleted
  • Status changed from closed to reopened

The dependencies of the package also need to be adjusted to make sure that openjdk-7 is installed.

comment:5 Changed 2 years ago by Don-vip

  • Resolution set to fixed
  • Status changed from reopened to closed

I have applied the following changes, for next release:

  • latest/DEBIAN/control

     
    22Version: 1.5.svn{{VERSION}}
    33Section: utils
    44Maintainer: josm developers <josm-dev@openstreetmap.org>
    5 Homepage: http://josm.openstreetmap.de
     5Homepage: https://josm.openstreetmap.de
    66Priority: extra
    77Architecture: all
    8 Depends: openjdk-6-jre | sun-java6-jre | openjdk-7-jre
     8Depends: openjdk-7-jre
    99Description: Editor for OpenStreetMap (daily development snapshot)
    1010 JOSM is an editor for OpenStreetMap (OSM) written in Java.
    1111  The current version supports stand alone GPX tracks, GPX track data
  • latest/usr/bin/josm-latest

     
    22# Simple wrapper script used to start JOSM in Debian
    33set -e
    44
    5 # First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK or Sun's proprietary JDK.
     5# First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK or Oracle's proprietary JDK.
    66# Override to a specific one using $JAVACMD
    77ALTERNATIVE_JDK="`readlink -n -f /etc/alternatives/java`"
    88
  • tested/usr/bin/josm

     
    22# Simple wrapper script used to start JOSM in Debian
    33set -e
    44
    5 # First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK or Sun's proprietary JDK.
     5# First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK or Oracle's proprietary JDK.
    66# Override to a specific one using $JAVACMD
    77ALTERNATIVE_JDK="`readlink -n -f /etc/alternatives/java`"
    88
  • tested/DEBIAN/control

     
    22Version: 1.5.svn{{VERSION}}
    33Section: utils
    44Maintainer: josm developers <josm-dev@openstreetmap.org>
    5 Homepage: http://josm.openstreetmap.de
     5Homepage: https://josm.openstreetmap.de
    66Priority: extra
    77Architecture: all
    8 Depends: openjdk-6-jre | sun-java6-jre | openjdk-7-jre
     8Depends: openjdk-7-jre
    99Conflicts: josm-plugins
    1010Replaces: josm-plugins
    1111Description: Editor for OpenStreetMap

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain bastiK.
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.