Closed facewise closed 4 months ago
@facewise
When I install maven and gradle in Windows env, there are executable binary files each.
maven
gradle
So, the original check command that using mvn
and gradle
works fine for me.
I don't understand why the check command for Windows needs to be changed.
Actually, I don't use Windows that much. Let me know if there is a reason the check command should be change.
@imbyungjun
Please see #975 .
As you can see, running check command line like gradle -version
on Windows cmd works fine.
But it seems that running command via the method named oshi.util.ExecutingCommand.runNative
doesn't.
@facewise
Thanks, The issue only occurred when running the command using oshi.
I have successfully reproduced the issue and confirmed that it is resolved in your PR. Thanks again for your contribution to nGrinder.
There were two major factors causing this bug.
System.getenv()
on initializing enums was failed on Windows.oshi.util.ExecutingCommand.runNative()
was failed on Windows due to Linux-specific command scripts.Changes
System.getenv()
after initializing.com.sun.jna.Platform.isWindows()
.Since
com.sun.jna.Platform
sets the static values of current OS on start, no needed to callSystem.getProperty("os.name")
again. But considered that the dependency includingcom.sun.jna.Platform
may be removed in future, it could be the best option to check by callingSystem.getProperty("os.name")
.