Index: /applications/editors/josm/plugins/javafx/README
===================================================================
--- /applications/editors/josm/plugins/javafx/README	(revision 35804)
+++ /applications/editors/josm/plugins/javafx/README	(revision 35805)
@@ -1,4 +1,4 @@
 README 
 ======
-This plugin provides the openjfx (JavaFX) library for JOSM plugins.
+This plugin provides openjfx (JavaFX) additional features such as MP3 audio playback.
     * Licensed under GPL v3 (see LICENSE)
Index: /applications/editors/josm/plugins/javafx/build.xml
===================================================================
--- /applications/editors/josm/plugins/javafx/build.xml	(revision 35804)
+++ /applications/editors/josm/plugins/javafx/build.xml	(revision 35805)
@@ -4,5 +4,5 @@
     <property name="commit.message" value="Commit message"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="14234"/>
+    <property name="plugin.main.version" value="18166"/>
 
     <!-- Configure these properties (replace "..." accordingly).
@@ -10,8 +10,6 @@
     -->
     <property name="plugin.author" value="Don-vip"/>
-    <property name="plugin.class.windows" value="org.openstreetmap.josm.plugins.javafx.JavaFxPluginWindows"/>
-    <property name="plugin.class.unixoid" value="org.openstreetmap.josm.plugins.javafx.JavaFxPluginUnixoid"/>
-    <property name="plugin.class.osx" value="org.openstreetmap.josm.plugins.javafx.JavaFxPluginOsx"/>
-    <property name="plugin.description" value="Provides the OpenJFX (JavaFX) library for JOSM core and other JOSM plugins. Provides additional features such as MP3 audio playback."/>
+    <property name="plugin.class" value="org.openstreetmap.josm.plugins.javafx.JavaFxPlugin"/>
+    <property name="plugin.description" value="Provides additional OpenJFX (JavaFX) features such as MP3 audio playback."/>
     <!--<property name="plugin.minimum.java.version" value="10"/>-->
     <property name="plugin.provides" value="javafx"/>
@@ -22,11 +20,5 @@
     <property name="plugin.stage" value="5"/>
 
-    <condition property="isWindows"><os family="Windows"/></condition>
-    <condition property="isUnix"><os family="Unix"/></condition>
-    <condition property="isMac"><os family="Mac"/></condition>
     <property name="plugin.dist.dir" location="../../dist"/>
-    <property name="plugin.jar"      location="${plugin.dist.dir}/${ant.project.name}-windows.jar" if:set="isWindows"/>
-    <property name="plugin.jar"      location="${plugin.dist.dir}/${ant.project.name}-osx.jar" if:set="isMac"/>
-    <property name="plugin.jar"      location="${plugin.dist.dir}/${ant.project.name}-unixoid.jar" if:set="isUnix"/>
 
 	<!-- ** include targets that all plugins have in common ** -->
@@ -37,60 +29,6 @@
     </target>
 
-    <macrodef name="build-native-manifest">
-        <attribute name="class"/>
-        <attribute name="manifest"/>
-        <attribute name="platform"/>
-        <sequential>
-            <copy file="MANIFEST" tofile="@{manifest}" />
-            <manifest file="@{manifest}" mode="update">
-                <attribute name="Plugin-Class" value="@{class}" />
-                <attribute name="Plugin-Platform" value="@{platform}" />
-            </manifest>
-        </sequential>
-    </macrodef>
-
-    <target name="additional-manifest">
-        <build-native-manifest platform="Windows" class="${plugin.class.windows}" manifest="${manifest.windows}"/>
-        <build-native-manifest platform="Unixoid" class="${plugin.class.unixoid}" manifest="${manifest.unixoid}" />
-        <build-native-manifest platform="Osx" class="${plugin.class.osx}" manifest="${manifest.osx}" />
-    </target>
-
-    <macrodef name="build-native-jar">
-        <attribute name="jar"/>
-        <attribute name="manifest"/>
-        <attribute name="qualifier"/>
-        <attribute name="copy"/>
-        <sequential>
-            <echo>Building @{qualifier} jar...</echo>
-            <!-- Building the JAR file directly from javafx jar files is awfully slow,
-                 see https://bz.apache.org/bugzilla/show_bug.cgi?id=43144 -->
-            <mkdir dir="${plugin.lib.dir}/@{qualifier}"/>
-            <unzip dest="${plugin.lib.dir}/@{qualifier}">
-                <patternset>
-                    <exclude name="META-INF/maven/*"/>
-                    <exclude name="META-INF/DEPENDENCIES"/>
-                    <exclude name="META-INF/LICENSE"/>
-                    <exclude name="META-INF/NOTICE"/>
-                    <exclude name="META-INF/*.RSA"/>
-                    <exclude name="META-INF/*.SF"/>
-                    <exclude name="module-info.class"/>
-                </patternset>
-                <fileset dir="${plugin.lib.dir}">
-                    <include name="*-@{qualifier}.jar"/>
-                    <include name="*-monocle*.jar"/>
-                </fileset>
-            </unzip>
-            <jar destfile="@{jar}" manifest="@{manifest}" manifestencoding="UTF-8" level="9">
-                <fileset dir="${plugin.build.dir}"/>
-                <fileset dir="${plugin.lib.dir}/@{qualifier}"/>
-            </jar>
-            <delete dir="${plugin.lib.dir}/@{qualifier}" failonerror="false" />
-        </sequential>
-    </macrodef>
-
     <target name="build-jar">
-        <build-native-jar jar="${plugin.unixoid.jar}" manifest="${manifest.unixoid}" qualifier="linux" copy="isUnix" />
-        <build-native-jar jar="${plugin.windows.jar}" manifest="${manifest.windows}" qualifier="win" copy="isWindows" />
-        <build-native-jar jar="${plugin.osx.jar}" manifest="${manifest.osx}" qualifier="mac" copy="isMac" />
+        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}" manifest="${manifest}" manifestencoding="UTF-8" duplicate="preserve" level="9"/>
     </target>
 </project>
Index: /applications/editors/josm/plugins/javafx/ivy.xml
===================================================================
--- /applications/editors/josm/plugins/javafx/ivy.xml	(revision 35804)
+++ /applications/editors/josm/plugins/javafx/ivy.xml	(revision 35805)
@@ -6,5 +6,5 @@
 	<dependencies>
         <dependency org="org.testfx" name="openjfx-monocle" rev="jdk-11+26"/>
-        <dependency org="org.openjfx" name="javafx-swing" rev="15.0.1">
+        <dependency org="org.openjfx" name="javafx-swing" rev="16">
             <artifact name="javafx-swing" type="jar" m:classifier="linux"/>
             <artifact name="javafx-swing" type="jar" m:classifier="mac"/>
@@ -13,5 +13,5 @@
             <artifact name="javafx-swing" type="jar" m:classifier="javadoc"/>
         </dependency>
-        <dependency org="org.openjfx" name="javafx-fxml" rev="15.0.1">
+        <dependency org="org.openjfx" name="javafx-fxml" rev="16">
             <artifact name="javafx-fxml" type="jar" m:classifier="linux"/>
             <artifact name="javafx-fxml" type="jar" m:classifier="mac"/>
@@ -20,5 +20,5 @@
             <artifact name="javafx-fxml" type="jar" m:classifier="javadoc"/>
         </dependency>
-        <dependency org="org.openjfx" name="javafx-web" rev="15.0.1">
+        <dependency org="org.openjfx" name="javafx-web" rev="16">
             <artifact name="javafx-web" type="jar" m:classifier="linux"/>
             <artifact name="javafx-web" type="jar" m:classifier="mac"/>
@@ -27,5 +27,5 @@
             <artifact name="javafx-web" type="jar" m:classifier="javadoc"/>
         </dependency>
-        <dependency org="org.openjfx" name="javafx-media" rev="15.0.1">
+        <dependency org="org.openjfx" name="javafx-media" rev="16">
             <artifact name="javafx-media" type="jar" m:classifier="linux"/>
             <artifact name="javafx-media" type="jar" m:classifier="mac"/>
@@ -34,5 +34,5 @@
             <artifact name="javafx-media" type="jar" m:classifier="javadoc"/>
         </dependency>
-        <dependency org="org.openjfx" name="javafx-controls" rev="15.0.1">
+        <dependency org="org.openjfx" name="javafx-controls" rev="16">
             <artifact name="javafx-controls" type="jar" m:classifier="linux"/>
             <artifact name="javafx-controls" type="jar" m:classifier="mac"/>
@@ -41,5 +41,5 @@
             <artifact name="javafx-controls" type="jar" m:classifier="javadoc"/>
         </dependency>
-        <dependency org="org.openjfx" name="javafx-base" rev="15.0.1">
+        <dependency org="org.openjfx" name="javafx-base" rev="16">
             <artifact name="javafx-base" type="jar" m:classifier="linux"/>
             <artifact name="javafx-base" type="jar" m:classifier="mac"/>
@@ -48,5 +48,5 @@
             <artifact name="javafx-base" type="jar" m:classifier="javadoc"/>
         </dependency>
-        <dependency org="org.openjfx" name="javafx-graphics" rev="15.0.1">
+        <dependency org="org.openjfx" name="javafx-graphics" rev="16">
             <artifact name="javafx-graphics" type="jar" m:classifier="linux"/>
             <artifact name="javafx-graphics" type="jar" m:classifier="mac"/>
Index: /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPlugin.java
===================================================================
--- /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPlugin.java	(revision 35804)
+++ /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPlugin.java	(revision 35805)
@@ -3,28 +3,8 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URISyntaxException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.StandardCopyOption;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.security.CodeSource;
 import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Objects;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
 
-import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.io.audio.AudioPlayer;
-import org.openstreetmap.josm.plugins.DynamicURLClassLoader;
 import org.openstreetmap.josm.plugins.Plugin;
 import org.openstreetmap.josm.plugins.PluginHandler;
@@ -33,24 +13,17 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.PlatformManager;
-import org.openstreetmap.josm.tools.Utils;
 
 /**
- * JavaFX plugin brings OpenJFX (JavaFX) to other plugins.
+ * JavaFX plugin brings OpenJFX (JavaFX) additional features.
  */
-abstract class JavaFxPlugin extends Plugin {
+public class JavaFxPlugin extends Plugin {
 
     /**
-     * Constructs a new {@code OpenJfxPlugin}.
+     * Constructs a new {@code JavaFxPlugin}.
      * @param info plugin info
-     * @param ext native libraries extension
-     * @param orderedNativeLibraries native libraries that must be loaded in this order
      */
-    protected JavaFxPlugin(PluginInformation info, String ext, List<String> orderedNativeLibraries) {
+    protected JavaFxPlugin(PluginInformation info) {
         super(info);
-        boolean isJavaFx = Utils.getSystemProperty("javafx.runtime.version") != null || ("Oracle Corporation".equals(Utils.getSystemProperty("java.vendor")) && Utils.getJavaVersion() < 11);
-        if (!isJavaFx && Utils.getJavaVersion() >= 10) {
-            extractNativeLibs(ext);
-            loadNativeLibs(ext, orderedNativeLibraries);
-        } else if (!isJavaFx) {
+        if (!isJavaFx()) {
             Logging.error("JavaFX is not available");
             StringBuilder message = new StringBuilder(tr("JavaFX is not available."));
@@ -69,82 +42,10 @@
     }
 
-    private static void extractNativeLibs(String ext) {
-        CodeSource src = JavaFxPlugin.class.getProtectionDomain().getCodeSource();
-        if (src != null) {
-            try (ZipFile zf = new ZipFile(Paths.get(src.getLocation().toURI()).toFile(), StandardCharsets.UTF_8)) {
-                Path dir = getNativeDir();
-                Enumeration<? extends ZipEntry> es = zf.entries();
-                while (es.hasMoreElements()) {
-                    ZipEntry ze = es.nextElement();
-                    String name = ze.getName();
-                    if (name.endsWith(ext) || name.endsWith(".jar")) {
-                        Path targetPath = dir.resolve(name);
-                        File targetFile = targetPath.toFile();
-                        if (!targetFile.exists() || targetFile.lastModified() < ze.getTime()) {
-                            try (InputStream is = zf.getInputStream(ze)) {
-                                Logging.debug("Extracting " + targetPath);
-                                Files.copy(is, targetPath, StandardCopyOption.REPLACE_EXISTING);
-                            }
-                        }
-                    }
-                }
-            } catch (IOException | URISyntaxException e) {
-                Logging.error(e);
-            }
-        } else {
-            Logging.error("Unable to locate javafx jar file");
-        }
-    }
-
-    private static Path getNativeDir() throws IOException {
-        return Files.createDirectories(new File(Preferences.main().getPluginsDirectory(), "javafx").toPath());
-    }
-
-    private static class LibVisitor extends SimpleFileVisitor<Path> {
-        private final ClassLoader ccl = Thread.currentThread().getContextClassLoader();
-        private final String ext;
-        private final List<String> orderedNativeLibraries;
-
-        public LibVisitor(String ext, List<String> orderedNativeLibraries) {
-            this.ext = Objects.requireNonNull(ext);
-            this.orderedNativeLibraries = Objects.requireNonNull(orderedNativeLibraries);
-        }
-
-        @Override
-        public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
-            if (ccl instanceof DynamicURLClassLoader) {
-                String path = file.toAbsolutePath().toString();
-                if (path.endsWith(ext) && !orderedNativeLibraries.contains(file.getFileName().toString())) {
-                    loadNativeLib(path);
-                } else if (path.endsWith(".jar")) {
-                    Logging.debug("Loading {0}", path);
-                    ((DynamicURLClassLoader) ccl).addURL(file.toUri().toURL());
-                }
-            } else {
-                Logging.error("Unexpected context class loader: " + ccl);
-                return FileVisitResult.TERMINATE;
-            }
-            return FileVisitResult.CONTINUE;
-        }
-    }
-
-    private static void loadNativeLib(String absolutePath) {
+    private boolean isJavaFx() {
         try {
-            Logging.debug("Loading {0}", absolutePath);
-            System.load(absolutePath);
-        } catch (LinkageError e) {
-            Logging.error(e);
-        }
-    }
-
-    private static void loadNativeLibs(String ext, List<String> orderedNativeLibraries) {
-        try {
-            Path nativeDir = getNativeDir();
-            Files.walkFileTree(nativeDir, new LibVisitor(ext, orderedNativeLibraries));
-            for (String lib : orderedNativeLibraries) {
-                loadNativeLib(nativeDir.resolve(lib).toAbsolutePath().toString());
-            }
-        } catch (IOException e) {
-            Logging.error(e);
+            return Class.forName("javafx.scene.Node") != null && Class.forName("javafx.scene.media.Media") != null;
+        } catch (ClassNotFoundException e) {
+            Logging.trace(e);
+            return false;
         }
     }
Index: plications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPluginOsx.java
===================================================================
--- /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPluginOsx.java	(revision 35804)
+++ 	(revision )
@@ -1,20 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.plugins.javafx;
-
-import java.util.Arrays;
-
-import org.openstreetmap.josm.plugins.PluginInformation;
-
-/**
- * OpenJFX plugin brings OpenJFX (JavaFX) to other plugins.
- */
-public class JavaFxPluginOsx extends JavaFxPlugin {
-
-    /**
-     * Constructs a new {@code JavaFxPluginOsx}.
-     * @param info plugin info
-     */
-    public JavaFxPluginOsx(PluginInformation info) {
-        super(info, ".dylib", Arrays.asList());
-    }
-}
Index: plications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPluginUnixoid.java
===================================================================
--- /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPluginUnixoid.java	(revision 35804)
+++ 	(revision )
@@ -1,20 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.plugins.javafx;
-
-import java.util.Arrays;
-
-import org.openstreetmap.josm.plugins.PluginInformation;
-
-/**
- * OpenJFX plugin brings OpenJFX (JavaFX) to other plugins.
- */
-public class JavaFxPluginUnixoid extends JavaFxPlugin {
-
-    /**
-     * Constructs a new {@code JavaFxPluginUnixoid}.
-     * @param info plugin info
-     */
-    public JavaFxPluginUnixoid(PluginInformation info) {
-        super(info, ".so", Arrays.asList());
-    }
-}
Index: plications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPluginWindows.java
===================================================================
--- /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPluginWindows.java	(revision 35804)
+++ 	(revision )
@@ -1,20 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.plugins.javafx;
-
-import java.util.Arrays;
-
-import org.openstreetmap.josm.plugins.PluginInformation;
-
-/**
- * OpenJFX plugin brings OpenJFX (JavaFX) to other plugins.
- */
-public class JavaFxPluginWindows extends JavaFxPlugin {
-
-    /**
-     * Constructs a new {@code JavaFxPluginWindows}.
-     * @param info plugin info
-     */
-    public JavaFxPluginWindows(PluginInformation info) {
-        super(info, ".dll", Arrays.asList("fxplugins.dll"));
-    }
-}
Index: /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/gui/JavaFxWrapper.java
===================================================================
--- /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/gui/JavaFxWrapper.java	(revision 35804)
+++ /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/gui/JavaFxWrapper.java	(revision 35805)
@@ -101,4 +101,5 @@
 
     /**
+     * Initializes FX
      * @return The scene to be used for initializing JavaFX
      */
