From 47bafd8afde9dd9731686de1a26ca8e22841fa11 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 2 Feb 2019 18:39:51 -0800 Subject: Fix path issue on Java 11 --- src/org/traccar/WindowsService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3