Locally declared variables can not be inspected

前端 未结 4 1736
借酒劲吻你
借酒劲吻你 2020-11-27 12:52

Sometimes when I am debugging code in Eclipse it happens that although I can see and inspect class member variables without any difficulty I am unable to inspect the values

4条回答
  •  渐次进展
    2020-11-27 13:39

    It used to be that you can get debug rt.jar from http: //download.java.net/jdk6/binaries/, but not any more.

    So building your own rt.jar with -g seems to be the only option now. It's very simple: just use javac and jar from your JDK.

    • mkdir \tmp; mkdir \tmp\out
    • Extract src.zip in JDK installation directory to tmp\src
    • cd src
    • find -name *.java > files.txt
    • javac -verbose -g -d \tmp\out -J-Xmx512m -cp "\jre\lib\rt.jar";"\lib\tools.jar" @files.txt
    • cd \tmp\out; jar cvf rt.jar *

    If you use Eclipse, you don't need -Xbootclasspath/p:, instead just put your debug jar to Bootstrap Entries before JRE in launch configuration.

提交回复
热议问题