@SuppressWarnings({"UseOfSunClasses"}) private VirtualMachine getVirtualMachineImplementationFromEmbeddedOnes() { try { if (File.separatorChar == '\\') { return new WindowsVirtualMachine(ATTACH_PROVIDER, pid); } else { return new LinuxVirtualMachine(ATTACH_PROVIDER, pid); } } catch (AttachNotSupportedException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } catch (UnsatisfiedLinkError ignore) { //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException throw new IllegalStateException( "Unable to load Java agent; please add lib/tools.jar from your JDK to the classpath"); } }
private static VirtualMachine getVirtualMachineImplementationFromEmbeddedOnes(String pid) { try { if (isWindows()) { return new WindowsVirtualMachine(ATTACH_PROVIDER, pid); } String osName = System.getProperty("os.name"); if (osName.startsWith("Linux") || osName.startsWith("LINUX")) { return new LinuxVirtualMachine(ATTACH_PROVIDER, pid); } else if (osName.startsWith("Mac OS X")) { return new BsdVirtualMachine(ATTACH_PROVIDER, pid); } else if (osName.startsWith("Solaris")) { return new SolarisVirtualMachine(ATTACH_PROVIDER, pid); } } catch (AttachNotSupportedException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } catch (UnsatisfiedLinkError e) { throw new IllegalStateException("Native library for Attach API not available in this JRE", e); } return null; }
private static VirtualMachine getVirtualMachineImplementationFromEmbeddedOnes(String pid) { try { if (isWindows()) { return new WindowsVirtualMachine(ATTACH_PROVIDER, pid); } String osName = System.getProperty("os.name"); if (osName.startsWith("Linux") || osName.startsWith("LINUX")) { return new LinuxVirtualMachine(ATTACH_PROVIDER, pid); } else if (osName.startsWith("Mac OS X")) { return new BsdVirtualMachine(ATTACH_PROVIDER, pid); } else if (osName.startsWith("Solaris")) { return new SolarisVirtualMachine(ATTACH_PROVIDER, pid); } } catch (AttachNotSupportedException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } catch (UnsatisfiedLinkError e) { throw new IllegalStateException("Native library for Attach API not available in this JRE", e); } return null; }
private static VirtualMachine getVirtualMachineImplementationFromEmbeddedOnes(String pid) { try { if (isWindows()) { return new WindowsVirtualMachine(ATTACH_PROVIDER, pid); } String osName = System.getProperty("os.name"); if (osName.startsWith("Linux") || osName.startsWith("LINUX")) { return new LinuxVirtualMachine(ATTACH_PROVIDER, pid); } else if (osName.startsWith("Mac OS X")) { return new BsdVirtualMachine(ATTACH_PROVIDER, pid); } else if (osName.startsWith("Solaris")) { return new SolarisVirtualMachine(ATTACH_PROVIDER, pid); } } catch (AttachNotSupportedException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } catch (UnsatisfiedLinkError e) { throw new IllegalStateException("Native library for Attach API not available in this JRE", e); } return null; }