package foo; import com.oracle.bundlers.Bundlers; import com.oracle.bundlers.StandardBundlerParam; import com.sun.javafx.tools.packager.bundlers.BundleParams; import com.sun.javafx.tools.packager.bundlers.ConfigException; import com.sun.javafx.tools.packager.bundlers.RelativeFileSet; import com.sun.javafx.tools.packager.bundlers.UnsupportedPlatformException; import java.io.File; import java.net.URISyntaxException; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; public class BundlerTestApp { static Bundlers bundlers = Bundlers.createBundlersInstance(); public static void main(String[] args) { final File jar = new File("C:\\temp\\SampleApp.jar"); final File tmpFolder = new File("C:\\temp\\"); Map params = new HashMap<>(); params.put(BundleParams.PARAM_APP_RESOURCES, new RelativeFileSet(tmpFolder, new HashSet<>(Arrays.asList(jar)))); params.put(StandardBundlerParam.MAIN_CLASS.getID(), "sampleapp.SampleApp"); params.put(StandardBundlerParam.APP_NAME.getID(), "APP_NAME"); params.put(StandardBundlerParam.LICENSE_FILE.getID(), new File("C:\\Temp\\License.lic")); bundlers.getBundlers() .stream().forEach(b -> { System.out.println(b.getID()); }); bundlers.getBundlers() .stream() .filter(b -> { return "windows.app".equalsIgnoreCase(b.getID()); }) .forEach(bundler -> { try { bundler.validate(params); } catch (UnsupportedPlatformException ex) { } catch (ConfigException ex) { ex.printStackTrace(); System.exit(1); } bundler.execute(params, tmpFolder); }); } }