Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#73773 - [josm] Unrecognized option with Java 8
Attached to Project:
Community Packages
Opened by Giovanni Harting (IdleGandalf) - Sunday, 13 February 2022, 14:47 GMT
Last edited by NicoHood (NicoHood) - Sunday, 29 May 2022, 07:08 GMT
Opened by Giovanni Harting (IdleGandalf) - Sunday, 13 February 2022, 14:47 GMT
Last edited by NicoHood (NicoHood) - Sunday, 29 May 2022, 07:08 GMT
|
DetailsJOSM does not start with Java 8. Works fine with 11.
Unrecognized option: --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED Steps to reproduce: Try to start JOSM with Java 8. josm 18360-2 |
This task depends upon
18360-2 added `JOSM_ARGS="--add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED"` to `/etc/conf.d/josm`, commenting out that line fixes it.
https://josm.openstreetmap.de/ticket/21649
https://bugs.archlinux.org/task/72953
```
#
# Parameters for JOSM editor
#
#JOSM_ARGS="-Xmx800M"
#FS#72953 https://bugs.archlinux.org/task/72953
JOSM_ARGS="--add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED"
```
This is my java version:
```
$ java -version
openjdk version "1.8.0_332"
OpenJDK Runtime Environment (build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (build 25.332-b09, mixed mode)
```
And this is the error:
```
$ josm
Unrecognized option: --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
```
I also want to note, that the package is **sourcing** the config file. This can be a security issue, I am very uncomfortable with this in the PKGBUILD:
`[ -f /etc/conf.d/josm ] && . /etc/conf.d/josm`
Seems weird that pacman didn't update it for us though.
```
$ archlinux-java status
Available Java environments:
java-11-openjdk
java-18-openjdk
java-8-openjdk (default)
```
I think we need to prepend the other versions to the PATH variable when running josm:
https://wiki.archlinux.org/title/java#Launching_an_application_with_the_non-default_java_version
Maybe like this:
export PATH="/usr/lib/jvm/java-18-openjdk/bin/:/usr/lib/jvm/java-17-openjdk/bin/:/usr/lib/jvm/java-11-openjdk/bin/:$PATH"
For me this works. You can try it out in a simple bash and run `josm` afterwards.
The problem is that JOSM maintains compatibility with Java 8+, and our official start script does a version check to figure out what options need to be passed to the launcher. I fairly recently did some work to make that script non-Debian specific, just so that other distributions (like Arch) could use it, instead of doing what happened here.
See my comment on #72953 for my suggested fix.