• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

debugging java hashmap source code using eclipse

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,
earlier had asked a question regarding load factor in Hahmap

In order to do some work on my own ( and not just ask without trying ! ) I tried setting up an eclipse project and in a method defined a HashMap.
When I hit F3 on my keyboard - eclipse specified that "Source not found"
"File rt.jar has no source " and a button with ::
"Attach source "

In my jdk I see a archive file "F:\jdk1.5.0_15\src.zip"
which is what I attached

Now I can see the source of the HashMap in eclipse

My problem being ::
I tried putting a breakpoint in the code of HashMap
and then run eclipse in debug mode

I get the following error :


Looked up google and see that one option specified is ::
This property " Add line number attributes to generated class files "
needs to be set

This property is enabled .
Checked via :: Window >> preferences >>Compiler
and also ::
Project >> Properties >> set to true here ( cant change in this view )

So can someone please tell me how to run Java collection code in debug mode in eclipse ?

This may not be the right forum but wastnt sure where to post it .

Thanks ,
~satish
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eclipse specific problem. Moving to IDEs.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The compiler option will only affect how your classes are compiled. The HashMap class already comes compiled with the JDK, so what matters here is how *Sun* compiled the JDK.

Make sure that under "installed JREs", you are using the JDK, not an JRE. Eclipse should pick up the sources automatically for you, and you shouldn't have any problems with line numbers any more.
 
satish bodas
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ilja for the help .
Now I am able to debug the source code of Java .
While debugging I was getting a error of the type ::
" sun.misc.launcher not found " - attach source

I didnt attach any source but after some time this error went off

Not sure why - but thanks I am now able to debug code

~satish
 
reply
    Bookmark Topic Watch Topic
  • New Topic