FS#78707 - [josm] Module javafx.web not found on launch

Attached to Project: Arch Linux
Opened by tuxayo (tuxayo) - Sunday, 04 June 2023, 22:07 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:18 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jaroslav Lichtblau (Dragonlord)
NicoHood (NicoHood)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 21
Private No


Description:after updating JOSM I tried to ran it and got:

Using /usr/bin/java to execute josm.
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.web not found

Installing java-openjfx didn't change anything.

Additional info:
~ ❯❯❯ java --version
openjdk 20.0.1 2023-04-18
OpenJDK Runtime Environment (build 20.0.1+9)
OpenJDK 64-Bit Server VM (build 20.0.1+9, mixed mode, sharing)

This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:18 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/josm/issues/3
Comment by tuxayo (tuxayo) - Sunday, 04 June 2023, 22:09 GMT
Sorry I missed setting the Severity field.
Comment by Manuel Reimer (M-Reimer) - Monday, 05 June 2023, 14:38 GMT
Same issue here. Changing the Java version did not help either:

$ java --version
openjdk 11.0.19 2023-04-18
OpenJDK Runtime Environment (build 11.0.19+7)
OpenJDK 64-Bit Server VM (build 11.0.19+7, mixed mode)
Comment by Alexander Minges (athemis) - Tuesday, 06 June 2023, 14:14 GMT
As a work around: JOSM starts when using jre8-openjdk. However, according to upstream it _should_ at least work with java-17 (which is doesn't for me even with java17-openjfx installed).
Comment by Eugene Dvoretsky (radioxoma) - Wednesday, 07 June 2023, 10:21 GMT
Running `josm` in terminal leads to error. However `java -jar /usr/share/java/josm/josm.jar` works with both jre-openjdk and jre17-openjdk. Looks like issue with `/usr/bin/josm` script. Also newer version 18746 has been released.
Comment by ronald (jronald) - Thursday, 08 June 2023, 03:46 GMT
Same here, `java -jar /usr/share/java/josm/josm.jar` works.
$ pacman -Qs jre
local/jre-openjdk 20.0.1.u9-3
OpenJDK Java 20 full runtime environment
local/jre-openjdk-headless 20.0.1.u9-3
OpenJDK Java 20 headless runtime environment
Comment by faded.solivagant (faded.solivagant) - Wednesday, 21 June 2023, 14:41 GMT
Same here.
openjdk 20.0.1 2023-04-18
OpenJDK Runtime Environment (build 20.0.1+9)
OpenJDK 64-Bit Server VM (build 20.0.1+9, mixed mode, sharing)
The issue is still present.
Comment by Yao Mitachi (yaomtc) - Thursday, 29 June 2023, 01:00 GMT
Also having this issue.

Possibly relevant: https://bugs.archlinux.org/task/72953

The josm-stable AUR package has the same version of JOSM but its much shorter /usr/bin/josm script works:

# source application-specific settings
while true; do
[ -f /etc/conf.d/josm ] && . /etc/conf.d/josm
java ${JOSM_ARGS} -cp "${CLASSPATH}" -Djosm.restart=true org.openstreetmap.josm.gui.MainApplication "$@"
[ $? -eq 9 ] || break
Comment by Arvid Norlander (VorpalGun) - Sunday, 06 August 2023, 15:04 GMT
Also running into this.

java --version
openjdk 20.0.2 2023-07-18
OpenJDK Runtime Environment (build 20.0.2+9)
OpenJDK 64-Bit Server VM (build 20.0.2+9, mixed mode, sharing)
Comment by sTiKyt (sTiKyt) - Thursday, 17 August 2023, 16:51 GMT
Same, `josm-stable` seems to work and provides same package.

I use it as a workaround for now
Comment by Frederik “Freso” S. Olesen (Freso) - Friday, 18 August 2023, 20:40 GMT
I noticed `JAVAFX_HOME="${JAVAFX_HOME:-/usr/share/openjfx/lib}"` in /usr/bin/josm and added a `JAVAFX_HOME=/usr/lib/jvm/default/lib/` line to /etc/conf.d/josm (java-openfx installs the needed .jar files to /usr/lib/jvm/java-20-openjdk/lib/; there’s no /usr/share/openjfx on my system), which just made it complain about "java.lang.LayerInstantiationException: Package jdk.internal.jimage in both module jrt.fs and module java.base" instead and I don’t know Java well enough to know how to fix or work around that.

Edit: New error seems to be an issue with how Arch installs OpenJFX into /usr/lib/jvm: https://stackoverflow.com/a/62899144/5193095
Edit 2: Based on that SO answer I adjusted JAVAFX_HOME in /etc/conf.d/josm to `JAVAFX_HOME=/usr/lib/jvm/default/lib/javafx.base.jar:/usr/lib/jvm/default/lib/javafx.web.jar:/usr/lib/jvm/default/lib/javafx.controls.jar:/usr/lib/jvm/default/lib/javafx.swing.jar:/usr/lib/jvm/default/lib/javafx.media.jar:/usr/lib/jvm/default/lib/javafx.graphics.jar:/usr/lib/jvm/default/lib/javafx.fxml.jar` and JOSM seems to work now, so that is another possible workaround for the time being if you want to minimise your AUR reliance. :) (`JAVAFX_HOME=/usr/lib/jvm/default/lib/javafx.base.jar:/usr/lib/jvm/default/lib/javafx.web.jar:/usr/lib/jvm/default/lib/javafx.controls.jar:/usr/lib/jvm/default/lib/javafx.swing.jar:/usr/lib/jvm/default/lib/javafx.media.jar:/usr/lib/jvm/default/lib/javafx.graphics.jar` seems to be the minimal required JAVAFX_HOME, but I’ve included javafx.fxml.jar in case anything actually uses that that just isn’t referenced yet at boot time. Not sure if Java actually works like that or not, but including it also doesn’t seem to break it, so 🤷)

Edit 3: Package with workaround‐fixes (and version bump) can be found at https://gitlab.archlinux.org/freso/josm/-/tree/47b89da2f9ad92e5757121e63031b86b295af29f if anyone is interested. I’d suggest to change $pkgrel to 0 so you’ll get the update from the repository whenever it gets fixed in the package proper. :)
Comment by Oid Maps (dreieck) - Sunday, 20 August 2023, 13:57 GMT
`/usr/bin/josm` is a debian-specific script. Maybe that's root cause of problem? See also https://bugs.archlinux.org/task/79420.
Comment by Oid Maps (dreieck) - Monday, 21 August 2023, 13:13 GMT
Actually, same issue here, also when starting josm.jar directly.
Comment by Popolon (Popolon) - Tuesday, 19 September 2023, 07:42 GMT
Same error:

dpkg: no packages found matching openjdk-*-jre
dpkg: no packages found matching openjdk-*-jre:amd64
Using /usr/bin/java to execute josm.
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.web not found

Installing java-openjfx, that isn't in dependencies (definitively should be) didn't resolved the issue.

Tried by installing java17-openjfx, I have the same issue.

I just noticed that jdk11-openjdk is still on my system, and if I try to remove it pacman complain about few application dependencies on it via java-environment dependence. Maybe the solution should be to switch by one way (don't know which one but removing all dependencies, removing v11 and reinstalling current version (v20) and the packages depending on it, after that.

* removing all old jdk/jre and their dependencies
* force a new installation of last jre-openjdk jre-openjdk-headless jdk-openjdk packages
* installing java-openjfx again
* changed /usr/bin/josm, as said in the https://bugs.archlinux.org/task/78707#comment219130
This works.
Comment by NicoHood (NicoHood) - Sunday, 15 October 2023, 07:40 GMT
Hey guys, I've updated the package. Please check if it works. Also we have an open task here, please check that out as well:
Comment by Benjamin (piratenpanda) - Sunday, 15 October 2023, 08:12 GMT
for me it still shows the same bug:

Using /usr/bin/java to execute josm.
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.web not found

archlinux-java status
Available Java environments:
java-17-openjdk (default)
Comment by NicoHood (NicoHood) - Sunday, 15 October 2023, 09:07 GMT
Does any of the fixes above help you?
Comment by Malte (malteger) - Sunday, 15 October 2023, 19:23 GMT
Works for me with java-17-openjdk and openjfx
Comment by dllud (dllud) - Sunday, 15 October 2023, 20:54 GMT
Confirmed here too. Works with java17-openjfx installed and `archlinux-java set java-17-openjdk`.
I guess the package dependencies should be updated accordingly.
However, it would be nice to keep java-openjfx as an optional dependency. Note that josm runs fine with the latest java version (21) when launched with `java -jar /usr/share/java/josm/josm.jar`. I hope you can tweak the launch script a bit more ;)
Comment by Benjamin (piratenpanda) - Monday, 16 October 2023, 17:29 GMT
Yeah when installing java17-openjfx it works fine. Thanks. Should be a dependency then I guess.
Comment by tuxayo (tuxayo) - Monday, 16 October 2023, 21:01 GMT
Weird that there is not a java21-openjfx package. So the java-openjfx would point to it instead of installing java 17 which isn't the default java so it doesn't work directly en the end.
Comment by Yao Mitachi (yaomtc) - Wednesday, 22 November 2023, 02:25 GMT
Still couldn't launch JOSM so I tried installing java17-openjfx, but this didn't work, still "Module javafx.web not found".

I removed all Java software, then reinstalled JOSM, and picked the java17 package when asked which version I wanted. Also installed java17-openjfx for good measure.

Now it works.
Comment by Stefan Haan (sthaan) - Saturday, 25 November 2023, 14:57 GMT
After upgrading to josm 18822-2 this issue persists (jre-openjdk 21.u35-8).
`java -jar /usr/share/java/josm/josm.jar` works without issues.