Skip to content

Commit

Permalink
Attach did not work on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ingokegel committed Jul 8, 2021
1 parent 2463e7a commit 238b35b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/browser/src/main/kotlin/browser/attach/Attach.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 238b35b

Please sign in to comment.