diff --git a/java/execution/impl/src/com/intellij/execution/runners/ProcessProxyFactoryImpl.java b/java/execution/impl/src/com/intellij/execution/runners/ProcessProxyFactoryImpl.java index e8764d29657d..6af48770e78d 100644 --- a/java/execution/impl/src/com/intellij/execution/runners/ProcessProxyFactoryImpl.java +++ b/java/execution/impl/src/com/intellij/execution/runners/ProcessProxyFactoryImpl.java @@ -54,7 +54,16 @@ public class ProcessProxyFactoryImpl extends ProcessProxyFactory { @Override public boolean isBreakGenLibraryAvailable() { - @NonNls final String libName = SystemInfo.isWindows ? "breakgen.dll" : "libbreakgen.so"; + @NonNls final String libName; + if (SystemInfo.isWindows) { + libName = "breakgen.dll"; + } + else if (SystemInfo.isMac) { + libName = "libbreakgen.jnilib"; + } + else { + libName = "libbreakgen.so"; + } return new File(PathManager.getBinPath() + File.separator + libName).exists(); } } \ No newline at end of file diff --git a/java/java-runtime/src/com/intellij/rt/execution/application/AppMain.java b/java/java-runtime/src/com/intellij/rt/execution/application/AppMain.java index 09e6dd5f12aa..1d723e246cae 100644 --- a/java/java-runtime/src/com/intellij/rt/execution/application/AppMain.java +++ b/java/java-runtime/src/com/intellij/rt/execution/application/AppMain.java @@ -38,20 +38,28 @@ public class AppMain { static { String binPath = System.getProperty(PROPERTY_BINPATH) + File.separator; final String osName = System.getProperty("os.name").toLowerCase(); + String arch = System.getProperty("os.arch").toLowerCase(); String libPath = null; if (osName.startsWith("windows")) { - if (System.getProperty("os.arch").equals("amd64")) { + if (arch.equals("amd64")) { libPath = binPath + "breakgen64.dll"; } else { libPath = binPath + "breakgen.dll"; } } else if (osName.startsWith("linux")) { - if (System.getProperty("os.arch").toLowerCase().equals("amd64")) { + if (arch.equals("amd64")) { libPath = binPath + "libbreakgen64.so"; } else { libPath = binPath + "libbreakgen.so"; } + } else if (osName.startsWith("mac")) { + if (arch.endsWith("64")) { + libPath = binPath + "libbreakgen64.jnilib"; + } else { + libPath = binPath + "libbreakgen.jnilib"; + } + } try { if (libPath != null) { @@ -59,7 +67,9 @@ public class AppMain { } } catch (UnsatisfiedLinkError e) { - //Do nothing, unknown os or some other error => no ctrl-break is available + if (new File(libPath).exists() && osName.startsWith("mac")) { + e.printStackTrace(); + } } } @@ -86,19 +96,16 @@ public class AppMain { System.exit(1); } } - } catch (IOException e) { - return; - } catch (IllegalArgumentException iae) { - return; - } catch (SecurityException se) { - return; + } catch (IOException ignored) { + } catch (IllegalArgumentException ignored) { + } catch (SecurityException ignored) { } } }, "Monitor Ctrl-Break"); try { t.setDaemon(true); t.start(); - } catch (Exception e) {} + } catch (Exception ignored) {} String mainClass = args[0]; String[] parms = new String[args.length - 1];