Antwort
Also soll die Datei in einem Ordner deine Wahl liegen?
Versuch mal das hier, um den Pfad der Datei zu bekommen.
String applicationDir = "";
try {
File file = new File(".");
applicationDir = file.getCanonicalPath();
} catch (Exception e) {
e.printStackTrace();
}
String pathToXML = applicationDir + File.separator + "resources" + File.separator + "userConfig.xml";
File file = new File("."); .... Holt sich den aktuellen Pfad, wo die jar liegt, also wo du diese ausgeführt hast, also wo diese liegt :D