System.getProperty("user.dir") might be inadequate
Issue #465
resolved
when running from the jar, it returns the directory from where the jar has been launched, which in a normal condition works fine
$ cd /path/to/dist/
$ java -jar NuBot.jar
System.getProperty("user.dir") will return /path/to/dist/
however, if the user does the following
$ cd /one/random/path/on/system
$ java -jar /path/to/dist/NuBot.jar
System.getProperty("user.dir") will be /one/random/path/on/system
possible solution http://stackoverflow.com/questions/4871051/getting-the-current-working-directory-in-java . Beware it might work differently when launching inside the IDE
Comments (4)
-
reporter -
reporter I am now going to systematically replace all the occurrences of System.getProperty("user.dir") with FileSystemUtils.getBotAbsolutePath()
-
reporter - changed status to resolved
-
reporter - changed milestone to 0.3.0 - UI
- Log in to comment
implemented FileSystem.getBotAbsolutePath();