Skip to content

Commit df02193

Browse files
Fix registering demo windows service when JAVA_HOME is not set
Use system property java.home in favor of environment variable JAVA_HOME to register the windows service.
1 parent 96f0adb commit df02193

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/platform/test/com/sun/jna/platform/win32/Win32ServiceDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public static boolean install() {
122122
}
123123
}
124124

125-
String JAVA_HOME = System.getenv("JAVA_HOME");
125+
String JAVA_HOME = System.getProperty("java.home", System.getenv("JAVA_HOME"));
126126
String javaBinary = "java.exe";
127127
if(JAVA_HOME != null) {
128128
javaBinary = "\"" + new File(JAVA_HOME, "\\bin\\java.exe").getAbsolutePath() + "\"";

0 commit comments

Comments
 (0)