public static String getName() { if (OS.isWindows()) { return "microsoft"; } if (OS.isMac()) { return "apple"; } if (OS.isLinux()) { return getLinuxOsReleaseId(); } if (OS.isAndroid()) { return "google"; } throw new UnsatisfiedLinkError("Unsupported vendor: " + getName()); }
public static String getLibFileExtension() { if (isWindows()) { return "dll"; } if (isMac()) { return "dylib"; } if (isLinux() || isAndroid() || isNativeClient()) { return "so"; } throw new UnsatisfiedLinkError("Unsupported platform library-extension for: " + getName()); } }
public static String getLibFileExtension() { if (isWindows()) { return "dll"; } if (isMac()) { return "dylib"; } if (isLinux() || isAndroid() || isNativeClient()) { return "so"; } throw new UnsatisfiedLinkError("Unsupported platform library-extension for: " + getName()); } }
/** * Returns the base-name for the native J2V8 library file. * @param withLinuxVendor include/exclude the {vendor} part from the returned filename * <p>NOTE: Vendors are only included for linux systems</p> * @return The filename string has the following structure: * <pre><code>{arch}-[vendor]-{operating_system}</pre></code> */ public static String computeLibraryShortName(boolean withLinuxVendor) { String prefix = "j2v8"; String vendor = withLinuxVendor && PlatformDetector.OS.isLinux() ? PlatformDetector.Vendor.getName() : null; String os = PlatformDetector.OS.getName(); String arch = PlatformDetector.Arch.getName(); final String separator = "-"; return prefix + (vendor != null ? separator + vendor : "") + separator + os + separator + arch; }
public static String getName() { if (OS.isWindows()) { return "microsoft"; } if (OS.isMac()) { return "apple"; } if (OS.isLinux()) { return getLinuxOsReleaseId(); } if (OS.isAndroid()) { return "google"; } throw new UnsatisfiedLinkError("Unsupported vendor: " + getName()); }
/** * Returns the base-name for the native J2V8 library file. * @param withLinuxVendor include/exclude the {vendor} part from the returned filename * <p>NOTE: Vendors are only included for linux systems</p> * @return The filename string has the following structure: * <pre><code>{arch}-[vendor]-{operating_system}</pre></code> */ public static String computeLibraryShortName(boolean withLinuxVendor) { String prefix = "j2v8"; String vendor = withLinuxVendor && PlatformDetector.OS.isLinux() ? PlatformDetector.Vendor.getName() : null; String os = PlatformDetector.OS.getName(); String arch = PlatformDetector.Arch.getName(); final String separator = "-"; return prefix + (vendor != null ? separator + vendor : "") + separator + os + separator + arch; }