Skip to content

Commit

Permalink
Fix module-path if javafxDir contains spaces (chunky-dev#785)
Browse files Browse the repository at this point in the history
* Fix module-path if javafxDir contains spaces

Adds double quotes around javafxDir fixing issues with directories like `C:\Program Files\AdoptOpenJDK\jdk-11.0.9.11-hotspot\lib`.

* Add comment
  • Loading branch information
jackjt8 authored Jan 19, 2021
1 parent ad3806d commit 4419bd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion launcher/src/se/llbit/chunky/launcher/ChunkyLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
*/
public class ChunkyLauncher {

public static final String LAUNCHER_VERSION = "v1.12.0";
public static final String LAUNCHER_VERSION = "v1.12.1";

/**
* Print a launch error message to the console.
Expand Down
3 changes: 2 additions & 1 deletion launcher/src/se/llbit/chunky/launcher/JavaFxLocator.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ private static void runWithJavafx(Path javafxDir, String[] args) {
cmd.add("--javaOptions");
StringBuilder javaOptions = new StringBuilder();
javaOptions.append("--module-path ");
javaOptions.append(javafxDir.toAbsolutePath().toString());
// Escape the path twice to make the second launcher pass the options to Chunky retaining the double speechmarks (fixes paths with spaces)
javaOptions.append("\\\"" + javafxDir.toAbsolutePath().toString() + "\\\"");
javaOptions.append(" --add-modules ");
javaOptions.append("javafx.controls,javafx.fxml");
cmd.add(javaOptions.toString());
Expand Down

0 comments on commit 4419bd7

Please sign in to comment.