1. background
You cannot see the value of a method parameter or a local variable when eclipse is debugging code in a Rt.jar that comes with a jdk.
This is because the debug information in the code is stripped out of the official version of the JDK released by Oracle. So to debug the code in Rt.jar in your usual work, you have to recompile the rt.jar.
2. steps
to Create a directory: Rt_debug (such as: F:\rt_debug )
putJava_home/src.zipcopied toRt_debugand unzip, and only keepJava,javax,orgthree directories (three commonly used completely enough)
put Java_home/jre/lib/rt.jar copied to Rt_debug in
-
dos cd f:\rt_debug
-
dir/b/s/x *.java > Files.txt (in rt_debug directory created files.txt, Save all .java file)
Create F:\rt_debug\classes Catalogue
DOS medium: javac-j-xms16m-j-xmx1024m-sourcepath.-cp./rt.jar-d./classes-g @files. txt (recompile and put into the classes Directory)
DOS medium: CD Classes
in Dos: jar cf0 Rt_debug.jar *(re-punch the compiled file into a jar Package)
Put Rt_debug.jar into Java_home/jre/lib.
Select I nstalled jres in eclipse,Select the appropriate jdk, Click edit, then select click Add External jars, Select Rt_debug.jar,up to Rt.jar
Eclipse supports debugging the Rt.jar that comes with JDK