Changes between Initial Version and Version 3 of Ticket #18809
- Timestamp:
- 2020-02-29T13:24:51+01:00 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #18809
- Property Summary JOSM uses unexpected java version → JOSM.exe uses unexpected java version
- Property Component Core → Installer Windows
-
Ticket #18809 – Description
initial v3 1 Originally encountered while debugging https://josm.openstreetmap.de/ticket/187691 Originally encountered while debugging #18769 2 2 3 3 Summary: … … 5 5 6 6 My experience: 7 I updated JOSM to latest, installed OpenJDK 13 and changed the %JAVA_HOME% environment variable to point to it. 7 I updated JOSM to latest, installed OpenJDK 13 and changed the `%JAVA_HOME%` environment variable to point to it. 8 8 9 9 When I opened a console and ran 10 {{{#!cmd 10 11 java -version 11 I get 12 OpenJdk version "13.0.2" 2020-01-14 12 }}} 13 I get `OpenJdk version "13.0.2" 2020-01-14` 13 14 14 15 When I ran 16 {{{ 15 17 C:\Program Files (x86)\JOSM\**josm-tested.jar** 18 }}} 16 19 The program is visually improved in many ways (layout, font etc) 17 20 In Help -> About -> Info 18 **Java Version is 13** 21 **Java Version is 13** 19 22 In Help -> About -> Installation Details 20 %JAVA_HOME% points to OpenJDK 13 21 <java.home> points to OpenJDK 13 23 `%JAVA_HOME%` points to OpenJDK 13 24 `<java.home>` points to OpenJDK 13 22 25 23 26 When I ran 27 {{{ 24 28 C:\Program Files (x86)\JOSM\**josm.exe** 29 }}} 25 30 The program is visually poor in many ways 26 31 In Help -> About -> Info 27 **Java Version is 8** 32 **Java Version is 8** 28 33 In Help -> About -> Installation Details 29 %JAVA_HOME% points to OpenJDK 13 30 <java.home> points to **java 8** 34 `%JAVA_HOME%` points to OpenJDK 13 35 `<java.home>` points to **java 8** 31 36 32 37 Situation which created the problem: … … 34 39 * I had downloaded the OpenJDK 13 JDK, but josm.exe is configured to prefer a JRE 35 40 * https://github.com/openstreetmap/josm/blob/23f812d89309fe7e1660efa1b2a21433305b5cfb/windows/launch4j.xml#L18 36 * I had correctly set the JAVA_HOME environment variable, but launch4j ignores JAVA_HOME and only looks at registry keys. This might change with the next release of launch4j. 41 * I had correctly set the `JAVA_HOME` environment variable, but launch4j ignores `JAVA_HOME` and only looks at registry keys. This might change with the next release of launch4j. 37 42 * https://sourceforge.net/p/launch4j/feature-requests/127/ 38 43 * While installing OpenJDK, I did not write java keys to registry … … 43 48 44 49 I suggest two changes to launch4j.xml to avoid this problem: 45 * <jdkPreference>preferJre</jdkPreference> 46 * should be: <jdkPreference>preferJdk</jdkPreference> 50 * `<jdkPreference>preferJre</jdkPreference>` 51 * should be: `<jdkPreference>preferJdk</jdkPreference>` 47 52 * Will take a JDK over a JRE 48 * <path></path> 49 * should be: <path>%JAVA_HOME%</path> 53 * `<path></path>` 54 * should be: `<path>%JAVA_HOME%</path>` 50 55 * Will negate the need to have registry keys, which are not always there for OpenJDK 51 56 52 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. 57 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.