Strange "missing JVM Arguments" message from JOSM

Whenever I run Josm now, this message appears:

It’s Josm 19067. I’m using OpenJDK on Windows, which is installed to “C:\Program Files\OpenJDK\jdk-22.0.1\bin\java.exe”. It is the only Java in the path. I am running it via “java -jar \path\to\josm-tested_19067.jar”.

I suspect the message is actually a Java message rather than a Josm one and may have started appearing when OpenJDK was updated.

What is it trying to tell me?

It’s trying to tell you that you should add those arguments if you are invoking josm manually via the commandline.
java --add-exports=java.base/ --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED -jar \path\to\josm-tested_19067.jar

The wrappers that are used to start josm if you install it via other methods already add those parameters, but if you are doing it manually you need to add them yourself.

That warning message was added because people kept getting issues and opening tickets because of the missing parameters. (See the numerous duplicate issues listed here): #21059 (JDK16 - IllegalAccessError: cannot access class [...] because module java.base does not export to unnamed module) – JOSM

It is a JOSM message:

I’ll add that you can ignore that dialog box if you want to, but "bad things might happen"™ depending upon what plugins you have installed. It may be possible for us to remove the need for this in the future, but I’ve got to poke some of our dependencies (the Java Platform Module System (JPMS) will let us specify what things are required, but we need all of our dependencies to be compatible, which has involved a bunch of poking/patches/etc.).

I’ll give it another go sometime, but it will probably be a year+ from when I implement JPMS support in JOSM before we can safely remove that message.

If you do ignore that dialog box and get an IllegalAccessError, we’ll just close the ticket you open as WORKSFORME.