diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-02-02 18:39:51 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-02-02 18:39:51 -0800 |
commit | 47bafd8afde9dd9731686de1a26ca8e22841fa11 (patch) | |
tree | 994ffe8a5f33214a885e552a6447571f3b9224d2 /src/org/traccar | |
parent | 56651897dc77998ddeda400a9ffee2e018e44dd0 (diff) | |
download | trackermap-server-47bafd8afde9dd9731686de1a26ca8e22841fa11.tar.gz trackermap-server-47bafd8afde9dd9731686de1a26ca8e22841fa11.tar.bz2 trackermap-server-47bafd8afde9dd9731686de1a26ca8e22841fa11.zip |
Fix path issue on Java 11
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/WindowsService.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/WindowsService.java b/src/org/traccar/WindowsService.java index 158aa5540..1906a6d50 100644 --- a/src/org/traccar/WindowsService.java +++ b/src/org/traccar/WindowsService.java @@ -55,7 +55,10 @@ public abstract class WindowsService { String javaBinary = javaHome + "\\bin\\java.exe"; File jar = new File(WindowsService.class.getProtectionDomain().getCodeSource().getLocation().toURI()); - String command = javaBinary + " -jar \"" + jar.getAbsolutePath() + "\" --service \"" + config + "\""; + String command = javaBinary + + " -Duser.dir=\"" + jar.getAbsolutePath() + "\"" + + " -jar \"" + jar.getParentFile().getAbsolutePath() + "\"" + + " --service \"" + config + "\""; boolean success = false; StringBuilder dep = new StringBuilder(); @@ -148,7 +151,6 @@ public abstract class WindowsService { WindowsService.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParent(); POSIXFactory.getPOSIX().chdir(path); - System.setProperty("user.dir", path); serviceMain = new ServiceMain(); SERVICE_TABLE_ENTRY entry = new SERVICE_TABLE_ENTRY(); |