Index: /applications/editors/josm/plugins/javafx/build.xml
===================================================================
--- /applications/editors/josm/plugins/javafx/build.xml	(revision 34712)
+++ /applications/editors/josm/plugins/javafx/build.xml	(revision 34713)
@@ -22,5 +22,13 @@
     <property name="plugin.stage" value="5"/>
 
-    <!-- ** include targets that all plugins have in common ** -->
+    <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 ** -->
     <import file="../build-common.xml"/>
 
@@ -78,5 +86,4 @@
             </jar>
             <delete dir="${plugin.lib.dir}/@{qualifier}" failonerror="false" />
-            <copy file="@{jar}" tofile="${plugin.jar}" if:set="@{copy}" />
         </sequential>
     </macrodef>
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 34712)
+++ /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPlugin.java	(revision 34713)
@@ -16,4 +16,5 @@
 import java.security.CodeSource;
 import java.util.Enumeration;
+import java.util.List;
 import java.util.Objects;
 import java.util.zip.ZipEntry;
@@ -37,10 +38,11 @@
      * @param info plugin info
      * @param ext native libraries extension
+     * @param orderedNativeLibraries native librarires that must be loaded in this order
      */
-    protected JavaFxPlugin(PluginInformation info, String ext) {
+    protected JavaFxPlugin(PluginInformation info, String ext, List<String> orderedNativeLibraries) {
         super(info);
         AudioPlayer.setSoundPlayerClass(JavaFxMediaPlayer.class);
         extractNativeLibs(ext);
-        loadNativeLibs(ext);
+        loadNativeLibs(ext, orderedNativeLibraries);
     }
 
@@ -80,7 +82,9 @@
         private final ClassLoader ccl = Thread.currentThread().getContextClassLoader();
         private final String ext;
+        private final List<String> orderedNativeLibraries;
 
-        public LibVisitor(String ext) {
+        public LibVisitor(String ext, List<String> orderedNativeLibraries) {
             this.ext = Objects.requireNonNull(ext);
+            this.orderedNativeLibraries = Objects.requireNonNull(orderedNativeLibraries);
         }
 
@@ -88,9 +92,9 @@
         public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
             if (ccl instanceof DynamicURLClassLoader) {
-                if (file.endsWith(ext)) {
-                    Logging.debug("Loading " + file);
-                    System.load(file.toAbsolutePath().toString());
-                } else if (file.endsWith(".jar")) {
-                    Logging.debug("Loading " + file);
+                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());
                 }
@@ -103,7 +107,20 @@
     }
 
-    private void loadNativeLibs(String ext) {
+    private static void loadNativeLib(String absolutePath) {
         try {
-            Files.walkFileTree(getNativeDir(), new LibVisitor(ext));
+            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);
Index: /applications/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 34712)
+++ /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPluginOsx.java	(revision 34713)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.javafx;
+
+import java.util.Arrays;
 
 import org.openstreetmap.josm.plugins.PluginInformation;
@@ -10,9 +12,9 @@
 
     /**
-     * Constructs a new {@code OpenJfxPlugin}.
+     * Constructs a new {@code JavaFxPluginOsx}.
      * @param info plugin info
      */
     public JavaFxPluginOsx(PluginInformation info) {
-        super(info, ".dylib");
+        super(info, ".dylib", Arrays.asList());
     }
 }
Index: /applications/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 34712)
+++ /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPluginUnixoid.java	(revision 34713)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.javafx;
+
+import java.util.Arrays;
 
 import org.openstreetmap.josm.plugins.PluginInformation;
@@ -10,9 +12,9 @@
 
     /**
-     * Constructs a new {@code OpenJfxPlugin}.
+     * Constructs a new {@code JavaFxPluginUnixoid}.
      * @param info plugin info
      */
     public JavaFxPluginUnixoid(PluginInformation info) {
-        super(info, ".so");
+        super(info, ".so", Arrays.asList());
     }
 }
Index: /applications/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 34712)
+++ /applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPluginWindows.java	(revision 34713)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.javafx;
+
+import java.util.Arrays;
 
 import org.openstreetmap.josm.plugins.PluginInformation;
@@ -10,9 +12,9 @@
 
     /**
-     * Constructs a new {@code OpenJfxPlugin}.
+     * Constructs a new {@code JavaFxPluginWindows}.
      * @param info plugin info
      */
     public JavaFxPluginWindows(PluginInformation info) {
-        super(info, ".dll");
+        super(info, ".dll", Arrays.asList("fxplugins.dll"));
     }
 }
