Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#18809 closed defect (wontfix)

JOSM.exe uses unexpected java version

Reported by: blackboxlogic@… Owned by: team
Priority: normal Milestone:
Component: Installer Windows Version:
Keywords: Cc: stoecker

Description (last modified by skyper)

Originally encountered while debugging #18769

Summary:
With some system configurations, josm.exe (with launch4j) uses java 8, josm-tested.jar uses java 13

My experience:
I updated JOSM to latest, installed OpenJDK 13 and changed the %JAVA_HOME% environment variable to point to it.

When I opened a console and ran

java -version

I get OpenJdk version "13.0.2" 2020-01-14

When I ran

C:\Program Files (x86)\JOSM\**josm-tested.jar**

The program is visually improved in many ways (layout, font etc)
In Help -> About -> Info

Java Version is 13

In Help -> About -> Installation Details

%JAVA_HOME% points to OpenJDK 13
<java.home> points to OpenJDK 13

When I ran

C:\Program Files (x86)\JOSM\**josm.exe**

The program is visually poor in many ways
In Help -> About -> Info

Java Version is 8

In Help -> About -> Installation Details

%JAVA_HOME% points to OpenJDK 13
<java.home> points to java 8

Situation which created the problem:

To work around the problem:

  • Download the OpenJDK 13 JRE (NOT JDK)
  • Select the installer option to write registry keys

I suggest two changes to launch4j.xml to avoid this problem:

  • <jdkPreference>preferJre</jdkPreference>
    • should be: <jdkPreference>preferJdk</jdkPreference>
    • Will take a JDK over a JRE
  • <path></path>
    • should be: <path>%JAVA_HOME%</path>
    • Will negate the need to have registry keys, which are not always there for OpenJDK

I am not well versed in java, launch4j, registry keys, or the JAVA_HOME environment variable. I have not tested my suggested changes and I don't know if it might break it for other people. Also, just waiting for the next release of launch4j might fix this.

Attachments (0)

Change History (16)

comment:1 by GerdP, 5 years ago

Summary: JOSM uses unexpected java versionJOSM.exe uses unexpected java version

comment:2 by Don-vip, 5 years ago

Component: CoreInstaller Windows

comment:3 by skyper, 5 years ago

Description: modified (diff)

layout improvements
{{{#!cmd }}} does not handle white spaces well.

comment:4 by blackboxlogic@…, 4 years ago

FYI, launch4j fixed the underlying issue (https://sourceforge.net/p/launch4j/feature-requests/127/). This issue will be resolved when/if JOSM updates to the latest launch4j.

comment:5 by Don-vip, 4 years ago

Milestone: 21.02

comment:6 by stoecker, 4 years ago

Milestone: 21.0221.03

Milestone renamed

comment:7 by Stereo, 4 years ago

Another option would be to adapt my macOS jpackage build process, which includes a jre and batteries and everything, to use jpackage to build a .exe. No idea how signing will work, and I'm not volunteering to code, test or troubleshoot since I'm not a Windows user.

comment:8 by GerdP, 4 years ago

I don't even understand why we have a JOSM.exe for Windows. I never needed it and it seems to cause extra trouble. Is it meant for those users who don't understand what a jar file is? Or maybe for the icon?

comment:9 by mkoniecz, 4 years ago

Is .exe working without java installed on the system? Or installing icons in start menu/dektop?

comment:10 by Stereo, 4 years ago

I suppose it's for convenience. The majority of users, these days, don't have a JRE installed, and don't want to mess with jar files.

No idea what the current behaviour is. The jpackage process would provide a JOSM that comes 'with batteries', including JRE and all.

If you're a Windows user, I can maybe guide you through the process over the JOSM chat?

Last edited 4 years ago by Stereo (previous) (diff)

comment:11 by GerdP, 4 years ago

As a Windows user I don't want to mess around with setup / installer packages when I just have to download a single jar file. I wonder why we provide all that OS dependent stuff when it is not needed at all.
I can start JOSM by double clicking on the *.jar file, I can start it from the command like or I can create an icon on the desktop to be able to use a shortcut, I can even use a small script to check if an update is available and download it automatically. I use all these methods, depending on the jar I want to start or the JRE version I want to use.

comment:12 by skyper, 4 years ago

Cc: stoecker added

I left Windows after XP but I would miss the apt-repository. Problem is the missing integration of the .jar-file within the OP-system which needs extra work for each system.

Once set up, scrips are perfect until some underlying structure is changed but that is still far from what we can expect from "normal" user trying to get JOSM to work, I guess.

@Dirk
I do not know anything about numbers comparing .exe and .jnlp usage on windows. Do you have any.

comment:13 by stoecker, 4 years ago

<jdkPreference>preferJre</jdkPreference> should be: <jdkPreference>preferJdk</jdkPreference> Will take a JDK over a JRE

Don't see this. A developer can download the JAR instead of the exe or properly install the JRE. For the majority of users the JRE should be preferred. The point with the java home looks like a followup to the same issue.

I do not know anything about numbers comparing .exe and .jnlp usage on windows. Do you have any.

The server does not have this. With a bit diggging I probably could find the download numbers, but that's all.

I suppose it's for convenience.

Yes. People expect to get an exe, so they get an exe. :-)

If there aren't any strong objections to my first point I consider this ticket WONTFIX.

comment:14 by anonymous, 4 years ago

EXE is meant for those users who don't understand what a jar file is?

I am not at my computer now, but I think the EXE included some command line arguments (about memory management?) when calling the JAR. I could write a .bat to add those arguments myself but that significantly raises the bar for your users.

WONTFIX

Thanks for looking. Can't win them all.

comment:15 by stoecker, 4 years ago

Resolution: wontfix
Status: newclosed

comment:16 by Don-vip, 4 years ago

Milestone: 21.03

Modify Ticket

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

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.