Skip to content

Commit

Permalink
feat: Handle clean Windows environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
jagodevreede committed Jul 12, 2024
1 parent 552cce6 commit 6f3a5f4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.jagodevreede.sdkman.api;

import com.sun.jna.platform.win32.Advapi32Util;
import com.sun.jna.platform.win32.Win32Exception;
import com.sun.jna.platform.win32.WinReg;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -47,7 +48,7 @@ public static String getGlobalPath() {
String[] split = pathQuery.split("\\s");

return split[split.length - 1].trim();
} catch (IllegalStateException e) {
} catch (IllegalStateException | Win32Exception e) {
// this can happen if there is no path set in the users environment variables
log.debug("Failed to get global path: {}", e.getMessage());
return "";
Expand Down
1 change: 1 addition & 0 deletions sdkman-api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
requires org.slf4j;
requires org.apache.commons.compress;
requires com.sun.jna.platform;
requires com.sun.jna;
exports io.github.jagodevreede.sdkman.api;
exports io.github.jagodevreede.sdkman.api.domain;
exports io.github.jagodevreede.sdkman.api.http;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[
{
"interfaces":["com.sun.jna.platform.win32.Advapi32"]}
,
{
"interfaces":["com.sun.jna.platform.win32.Kernel32"]}

]
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
"name":"com.sun.jna.ptr.IntByReference",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"com.sun.jna.ptr.PointerByReference",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"com.sun.jna.win32.DLLCallback"
},
Expand Down

0 comments on commit 6f3a5f4

Please sign in to comment.