From 238b35b135d4ac18b6f1b91ddacdfb1132c61f83 Mon Sep 17 00:00:00 2001 From: Ingo Kegel Date: Thu, 8 Jul 2021 22:17:33 +0200 Subject: [PATCH] Attach did not work on macOS --- modules/browser/src/main/kotlin/browser/attach/Attach.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/browser/src/main/kotlin/browser/attach/Attach.kt b/modules/browser/src/main/kotlin/browser/attach/Attach.kt index f4b7b8b8..f6901c55 100644 --- a/modules/browser/src/main/kotlin/browser/attach/Attach.kt +++ b/modules/browser/src/main/kotlin/browser/attach/Attach.kt @@ -8,6 +8,7 @@ package org.gjt.jclasslib.browser import com.exe4j.runtime.LauncherEngine +import com.install4j.api.Util import com.sun.tools.attach.VirtualMachine import com.sun.tools.attach.VirtualMachineDescriptor import org.gjt.jclasslib.browser.BrowserBundle.getString @@ -79,7 +80,8 @@ fun attachToVm(parentWindow: Window?): VmConnection? = private fun getAgentPath(): String = (File( - System.getProperty(LauncherEngine.PROPNAME_MODULE_NAME)?.let { File(it, "../../lib/") } + System.getProperty(LauncherEngine.PROPNAME_MODULE_NAME) + ?.let { File(it, if (Util.isMacOS()) "Contents/Resources/app/lib" else "../../lib/") } ?: File("build/gradle/agent/libs/"), "jclasslib-agent.jar" )).canonicalPath