Why does executing debug in 0.13.7 fail with “Could not find agent library jdwp:transport on the library path”?

后端 未结 4 591
刺人心
刺人心 2021-01-11 18:13

After update from 0.13.6 to 0.13.7 I cannot debug with SBT. It is installed using Homebrew. I tried to reinstall it,

相关标签:
4条回答
  • 2021-01-11 18:40

    It is installed using Homebrew.

    Homebrew install is sanctioned by sbt project as a recommended way to install on Mac, but we (I'm one of the sbt devs) currently don't control it. We do however have the official package sbt/sbt-launcher-package, and last I checked Homebrew is also using it.

    Looking at git blame of the relevant part of the script, it seems like the debug option was "fixed" in sbt/sbt-launcher-package#83:

    In sbt-launch-lib.bash, -Xdebug option is used for debugging. We should use -agentlib option for Java 5+.

    Maybe your issue should be tracked as a bug in sbt/sbt-launcher-package.

    0 讨论(0)
  • 2021-01-11 18:41

    At my case the bash fix didn't help but running from bash as:

    export SBT_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" 
    sbt
    

    helped. It is from here.

    0 讨论(0)
  • 2021-01-11 18:42

    To piggyback on Eugene's answer above, since the fix is in a bash script, it is pretty easy to apply the fix from https://github.com/sbt/sbt-launcher-package/pull/85/files manually. Just edit bin/sbt-launch-lib.bash to have this:

    addJava "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$1"
    

    Instead of this:

    addJava "-agentlib:jdwp:transport=dt_socket,server=y,suspend=n,address=$1"
    

    (Mind the : not = between jdwp and transport).

    0 讨论(0)
  • 2021-01-11 18:51

    The problem was fixed in the 0.13.8 version.

    0 讨论(0)
提交回复
热议问题