diff --git a/docs/README.md b/docs/README.md index 004d4cde5b..e7bd0c4b09 100644 --- a/docs/README.md +++ b/docs/README.md @@ -27,7 +27,8 @@ It is optimized for keyboard users, but has a GUI for the looks as well. - Download the latest jar from the [release page](https://github.com/RezwanArefin01/ip/releases/). - Copy the file to the folder you want to use as the home folder for your Duke. - Make sure the directory has read and write permissions. -- Double-click the file to start the app. If it does not work then try running `java -jar duke.jar` in a terminal. +- Run `java -jar duke.jar` in a terminal to start Duke. A data directory will be created in the location you execute the command from. + - Do not use double click to start the application. Because your OS can decide to execute the command from a different place. - Enter `help` to get started! # Features diff --git a/src/main/java/duke/ui/Gui.java b/src/main/java/duke/ui/Gui.java index fcaae5e9f0..0fd07f8a21 100644 --- a/src/main/java/duke/ui/Gui.java +++ b/src/main/java/duke/ui/Gui.java @@ -37,7 +37,7 @@ public void start(Stage stage) { stage.setScene(scene); // create path = current directory / data / data.txt - Path path = Paths.get(".", "data", "data.txt"); + Path path = Paths.get(System.getProperty("user.dir"), "data", "data.txt"); fxmlLoader.getController().initDuke(path); stage.show();