Java debugging - cannot be resolved [message #515146] |
Wed, 17 February 2010 16:37  |
Eclipse User |
|
|
|
Using Eclipse Version: 3.4.1
Build id: M20080911-1700
Workspace default JRE jdk1.6.0_01
I'm trying to debug into the Swing components to better understand them.
FYI: My main code is the TableExample3.Java from C:\Program Files\Java\jdk1.6.0_01\demo\jfc\TableExample\src folder.
I having some of usage problems with the debugger, I need some advice.
When I run the debugger and step into a Swing method, and look at the Variables tab, the method parameters are referred to as "arg0", "arg1", etc rather than their source names. The values are correct. The source code is visible in a source window, where I set the breakpoint. I cannot view expressions using real variable names. I try to set a "watch" using the variable names and it always says "..cannot be resolved". It seems there is some problem with associating the source with the library, yet the debugger is aware of the source since it displays it in a pane.
I have tried two different ways to associate the Swing source with the runtime code: 1) in the project properties, associated the source for the rt.jar 2) compiled the Swing source myself, created a jar, and added the jar to my project libraries, and associated the source. I even added the source into my Swing jar using the export utility. But I always see the parameter variables as "arg0", etc, and I cannot view expressions by variable names (unless I type in "arg0", etc).
Everything works fine in my project source. If I step into a method in the project (not in a library), the method parameters are displayed with their real names in the "Variables" tab and I can set expressions.
[Updated on: Wed, 17 February 2010 16:40] by Moderator
|
|
|
|
|
|
|
|
|
|
Re: Java debugging - cannot be resolved [message #515679 is a reply to message #515491] |
Fri, 19 February 2010 13:20   |
Eclipse User |
|
|
|
Eclipse User wrote on Thu, 18 February 2010 19:21 | Originally posted by: richkulp.us.NO_SPAM.ibm.com
Hi,
Um, you can't replace java classes that already exist in the rt.jar. Is
that what you did? Java doesn't allow you to do that. You can only add
classes.
|
I thought I read somewhere that the class loader uses the ordering in the class path to find and load classes, but that's an area I'm not clear enough on. So maybe I'm stuck not seeing variables in the debugger.
--------------------------------
More info if you're interested.
(BTW: Is there a way to see the actual command that Eclipse uses to run the project application to verify the classpath?)
The debugger seems to know about overlapping libraries -- when I do add "myswing.jar" to the libraries, duplicating the existing Swing classes, and attach the project source to "myswing.jar" and also attach the JDK source to the rt.jar, then the debugger asks which source I want to use when it enters a Swing routine.
It seems then that the debugger knows that there are overlapping libraries, but doesn't know which one it is running perhaps? But no matter what I choose, I can't "watch" or inspect variables other than the method parameters (arg0, etc).
That seems consistent with what you said about not being able to replace classes in rt.jar, if in fact it always runs the Swing code in rt.jar, ignoring "myswing.jar".
The way around it may be to actually include the Swing source in my project, rather than making a separate project and jar. I'll try that.
-SB
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.37238 seconds