How can I enable remote debugging for SBT in windows?

前端 未结 3 2042
庸人自扰
庸人自扰 2020-12-29 07:13

I would like to accomplish running the equivalent of this

sbt -jvm-debug 5005

However I don\'t seem to be able to pass in args in Windows.

相关标签:
3条回答
  • 2020-12-29 07:34
    set SBT_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
    sbt run
    

    was the only working solution on Windows 7.

    0 讨论(0)
  • 2020-12-29 07:41

    Currently, I'd downloaded the last updated sbt, exactly sbt 1.3.3 but when I want to enable debug in the project, I had the same problem as you. Investigating, I could see that I haven't this file (sbt-launch-lib.bash) in my own root C:\Program Files (x86)\sbt\bin so when I see in another machine, I could notice that sbt, It was 1.2.8 and yes it had the file that I mentioned before so I uninstalled sbt 1.3.3 and I installed sbt 1.2.8 and put in my project sbt -jvm-debug 9999 and it works.

    0 讨论(0)
  • 2020-12-29 07:48

    Seems like the Windows version of SBT doesn't define this functionality.

    On Linux it is defined in the $SBT_HOME/sbt/bin/sbt-launch-lib.bash as

    addDebugger () {   
      addJava "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1" 
    }
    

    You can achieve the same result by setting the SBT_OPTS environmental variable on Windows.

    Run SBT like this, to make the debugger listen on port 5005

    set SBT_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" && sbt
    
    0 讨论(0)
提交回复
热议问题