Index: applications/editors/josm/plugins/osmarender/build.xml
===================================================================
--- applications/editors/josm/plugins/osmarender/build.xml	(revision 33915)
+++ applications/editors/josm/plugins/osmarender/build.xml	(revision 33916)
@@ -5,5 +5,5 @@
     <property name="commit.message" value="Fixed #4360 - osmarender plugin does not load"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="10580"/>
+    <property name="plugin.main.version" value="13007"/>
 
     <property name="stylesheets" location="./stylesheets"/>
Index: applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java
===================================================================
--- applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java	(revision 33915)
+++ applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java	(revision 33916)
@@ -8,9 +8,11 @@
 import java.io.BufferedReader;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileOutputStream;
-import java.io.FileReader;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
+import java.nio.charset.StandardCharsets;
 import java.util.HashSet;
 import java.util.Set;
@@ -33,6 +35,8 @@
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MainMenu;
 import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
@@ -44,4 +48,5 @@
 import org.openstreetmap.josm.plugins.PluginInformation;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.PlatformHookWindows;
 
@@ -56,5 +61,5 @@
         @Override
         public void actionPerformed(ActionEvent e) {
-            DataSet ds = Main.getLayerManager().getEditDataSet();
+            DataSet ds = MainApplication.getLayerManager().getEditDataSet();
             if (ds == null) {
                 return;
@@ -62,6 +67,7 @@
 
             // get all stuff visible on screen
-            LatLon bottomLeft = Main.map.mapView.getLatLon(0,Main.map.mapView.getHeight());
-            LatLon topRight = Main.map.mapView.getLatLon(Main.map.mapView.getWidth(), 0);
+            MapView mapView = MainApplication.getMap().mapView;
+            LatLon bottomLeft = mapView.getLatLon(0, mapView.getHeight());
+            LatLon topRight = mapView.getLatLon(mapView.getWidth(), 0);
             Bounds b = new Bounds(bottomLeft, topRight);
 
@@ -70,10 +76,11 @@
             } catch (IOException ex) {
                 // how handle the exception?
-            	Main.error(ex);
+            	Logging.error(ex);
             }
 
             String firefox = Main.pref.get("osmarender.firefox", "firefox");
+            String pluginDir = getPluginDirs().getUserDataDirectory(false).getPath();
             try (OsmWriter w = OsmWriterFactory.createOsmWriter(new PrintWriter(new OutputStreamWriter(
-                    new FileOutputStream(getPluginDir()+File.separator+"data.osm"), "UTF-8")), false, "0.6")) {
+                    new FileOutputStream(pluginDir+File.separator+"data.osm"), "UTF-8")), false, "0.6")) {
                 // write to plugin dir
                 w.header();
@@ -118,7 +125,7 @@
                 String argument;
                 if (Main.platform instanceof PlatformHookWindows)
-                    argument = "file:///"+getPluginDir().replace('\\','/').replace(" ","%20")+File.separator+"generated.xml\"";
+                    argument = "file:///"+pluginDir.replace('\\','/').replace(" ","%20")+File.separator+"generated.xml\"";
                 else
-                    argument = getPluginDir()+File.separator+"generated.xml";
+                    argument = pluginDir+File.separator+"generated.xml";
 
                 // launch up the viewer
@@ -140,5 +147,5 @@
     public OsmarenderPlugin(PluginInformation info) throws IOException {
         super(info);
-        osmarenderMenu = MainMenu.add(Main.main.menu.viewMenu, new Action());
+        osmarenderMenu = MainMenu.add(MainApplication.getMenu().viewMenu, new Action());
         osmarenderMenu.setVisible(false);
 
@@ -203,9 +210,10 @@
             "minlon=\"" + b.getMin().lon() + "\" " +
             "maxlon=\"" + b.getMax().lon() + "\" " + "/>";
+        String pluginDir = getPluginDirs().getUserDataDirectory(false).getPath();
 
         try (
             BufferedReader reader = new BufferedReader(
-                    new FileReader( getPluginDir() + File.separator + "osm-map-features.xml") );
-            PrintWriter writer = new PrintWriter( getPluginDir() + File.separator + "generated.xml", "UTF-8");
+                    new InputStreamReader(new FileInputStream(pluginDir + File.separator + "osm-map-features.xml"), StandardCharsets.UTF_8));
+            PrintWriter writer = new PrintWriter( pluginDir + File.separator + "generated.xml", "UTF-8");
         ) {
             // osm-map-features.xml contain two placemark
