I am using Eclipse 3.5 and I attached the src.zip to my global settings in Eclipse. Windows--> Preferences -->Java -->Installed JREs -->rt.jar - Source attachment - ...../j
You should not use a JRE with a JDR src attached as the JRE classes are not well suited for debugging.
Let Eclipse search for Java environments and then select the JDK from the resulting list. This Java environment will have the src.zip attached correctly and you should be able to investigate.
Note that even JDK classes do not have full debugging information available, so you cannot see local variables etc.
(Also, the Compiler settings panel only applies to your code. The JRE classes are pregenerated and the panel does not influence them).
You may have the compiler set to include debugging information in YOUR class files, but the class files in rt.jar weren't compiled that way. You need to either recompile all the source for the classes in rt.jar (not for the faint of heart), or download a debug build of the jdk.
This blog posts give a comprehensive list of points to check
Follow the steps if you are compiling using Eclipse IDE
- Go to
windows > preferences > Java > compiler
screen.- Make sure that add line number attributes to generated files (used by debugger) check box is checked.
- Build again and try adding a breakpoint ahd hope it should work for you.
Note for ant builds
Follow the steps if you are compiling using ANT utility:
- Check the build.xml file and make sure that debug attribute is set to true in javac task
- Also, if you are using JBoss as an app server, then make sure that you have already opened a port for socket binding of remote machine connection. If not then just ensure that
C:/jboss/bin/run.bat
has an entry with:
"set JAVA_OPTS=%JAVA_OPTS% -Xdebug –Xrunjdwp:transport=dt_socket,address=5000,server=y,suspend=n
" for opening port 5000 to listen all socket connections for debug/remote java application.- Build again and try adding a breakpoint ahd hope it should work for you.