Index: trunk/src/org/openstreetmap/josm/tools/OverpassTurboQueryWizard.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/OverpassTurboQueryWizard.java	(revision 9855)
+++ trunk/src/org/openstreetmap/josm/tools/OverpassTurboQueryWizard.java	(revision 9856)
@@ -3,8 +3,5 @@
 
 import java.io.IOException;
-import java.io.InputStreamReader;
 import java.io.Reader;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
 
 import javax.script.Invocable;
@@ -14,4 +11,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.io.CachedFile;
 
 /**
@@ -40,9 +38,17 @@
 
     private OverpassTurboQueryWizard() {
-        try (final Reader reader = new InputStreamReader(
-                getClass().getResourceAsStream("/data/overpass-wizard.js"), StandardCharsets.UTF_8)) {
+
+        try (final CachedFile file = new CachedFile("resource://data/overpass-wizard.js");
+             final Reader reader = file.getContentReader()) {
             engine.eval("var console = {error: " + Main.class.getCanonicalName() + ".warn};");
             engine.eval("var global = {};");
             engine.eval(reader);
+            engine.eval("var overpassWizard = function(query) {" +
+                    "  return global.overpassWizard(query, {" +
+                    "    comment: false," +
+                    "    outputFormat: 'xml'," +
+                    "    outputMode: 'recursive_meta'" +
+                    "  });" +
+                    "}");
         } catch (ScriptException | IOException ex) {
             throw new RuntimeException("Failed to initialize OverpassTurboQueryWizard", ex);
@@ -58,11 +64,5 @@
     public String constructQuery(String search) throws UncheckedParseException {
         try {
-            final Object result = ((Invocable) engine).invokeMethod(engine.get("global"),
-                    "overpassWizard", search, new HashMap<String, Object>() { {
-                        put("comment", false);
-                        put("outputFormat", "xml");
-                        put("outputMode", "recursive_meta");
-                    } }
-            );
+            final Object result = ((Invocable) engine).invokeFunction("overpassWizard", search);
             if (Boolean.FALSE.equals(result)) {
                 throw new UncheckedParseException();
Index: trunk/test/unit/org/openstreetmap/josm/tools/OverpassTurboQueryWizardTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/OverpassTurboQueryWizardTest.java	(revision 9855)
+++ trunk/test/unit/org/openstreetmap/josm/tools/OverpassTurboQueryWizardTest.java	(revision 9856)
@@ -5,5 +5,4 @@
 
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.openstreetmap.josm.JOSMFixture;
@@ -27,5 +26,4 @@
      */
     @Test
-    @Ignore("see #12514 - Test does not work with Java 7, to enable after Java 8 migration if not fixed in the meantime")
     public void testKeyValue() {
         final String query = OverpassTurboQueryWizard.getInstance().constructQuery("amenity=drinking_water");
