diff --git a/sdkman-bundled-software/src/main/java/io/github/jagodevreede/sdkmanui/bundle/BundledSoftware.java b/sdkman-bundled-software/src/main/java/io/github/jagodevreede/sdkmanui/bundle/BundledSoftware.java index 3edfa4c..77527de 100644 --- a/sdkman-bundled-software/src/main/java/io/github/jagodevreede/sdkmanui/bundle/BundledSoftware.java +++ b/sdkman-bundled-software/src/main/java/io/github/jagodevreede/sdkmanui/bundle/BundledSoftware.java @@ -13,14 +13,12 @@ public class BundledSoftware { * Returns a stream of the bundled software, or null if the bundled software is not available. */ public static InputStream getSoftwareStream() { - return BundledSoftware.class.getClassLoader().getResourceAsStream("3rdparty.zip"); + return BundledSoftware.class.getClassLoader().getResourceAsStream("/3rdparty.zip"); } public static void extract(File destinationFolder) throws IOException { InputStream softwareStream = getSoftwareStream(); - if (softwareStream == null) { - return; - } + destinationFolder.mkdirs(); // extract zip file byte[] buffer = new byte[1024]; ZipInputStream zis = new ZipInputStream(softwareStream); diff --git a/sdkman-ui/src/main/java/io/github/jagodevreede/sdkmanui/ConfigurationUtil.java b/sdkman-ui/src/main/java/io/github/jagodevreede/sdkmanui/ConfigurationUtil.java index 148cae7..c05ce55 100644 --- a/sdkman-ui/src/main/java/io/github/jagodevreede/sdkmanui/ConfigurationUtil.java +++ b/sdkman-ui/src/main/java/io/github/jagodevreede/sdkmanui/ConfigurationUtil.java @@ -25,7 +25,9 @@ public final class ConfigurationUtil { static boolean preCheck(Stage stage) throws IOException { SdkManUiPreferences sdkManUiPreferences = ServiceRegistry.INSTANCE.getSdkManUiPreferences(); if (!sdkManUiPreferences.donePreCheck) { + logger.debug("Pre-check not done, checking"); if (BundledSoftware.getSoftwareStream() != null) { + logger.info("Extracting bundled software"); File installFolder = new File(ServiceRegistry.INSTANCE.getApi().getBaseFolder(), "ui" + separator + "3rdparty"); FileUtil.deleteRecursively(installFolder); BundledSoftware.extract(installFolder.getParentFile());