Skip to content

Commit c45992c

Browse files
tillscolleolleolle
authored andcommitted
Fix problems with spaces in path names under windows
1 parent f10ed60 commit c45992c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/JarMain.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ public class JarMain implements Runnable {
4242
URL mainClass = getClass().getResource(MAIN);
4343
URI uri;
4444
File file;
45+
String pathWithoutMain;
4546

4647
try {
4748
this.path = mainClass.toURI().getSchemeSpecificPart();
48-
uri = new URI(this.path.replace("!" + MAIN, ""));
49+
pathWithoutMain = mainClass.toURI().getRawSchemeSpecificPart().replace("!" + MAIN, "");
50+
uri = new URI(pathWithoutMain);
4951
}
5052
catch (URISyntaxException e) {
5153
throw new RuntimeException(e);

0 commit comments

Comments
 (0)