Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

IntelliJ IDEA Debugging Question

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on an application and using a 3rd party library. I'm running into issues and I can't tell if it is my code or the 3rd party's code. I have their source code but since I am using their JAR file(s) in my project when I debug I'm not able to see the actual method implementations.

Is there a way to attach source code to a project from an external location just for debugging? So that when I step through I can actually step their their source code as well?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alright, with a bit of help I managed to figure this out. You go to Project Settings and in the Libraries/Global Libraries section there is an Attach Sources button. Once the sources are attached you set breakpoints on the code by using the project view's tree. Just find the Libraries node, usually right under your module node. Expand it and find the library and you can double click the classes. Since the source code is no linked you get a view of the source code and are able to set breakpoints.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your approach worked for me, thanks for that.

I found your post after doing a google search
for "debug third-party code with Intellij IDEA".

Which version of IntelliJ IDEA are you using?
I am currently working by using Intellij IDEA 7.0.5.

But I was expecting to get that behaviour (which you describe) by
adding the third party sources to the Application Server definition:
-> Click "Run"
-> Click "Edit Configurations"
-> Choose some Tomcat/JBoss server configuration which you already defined in IntelliJ IDEA
-> From the right container, from the server tab choose "Configure"
-> Click "Attach Sources"

So my question is: if my expectation is wrong, what is
the meaning of "Attach Sources" there (where I described) ?

Thanks in advance.

 
A wop bop a lu bop a womp bam boom! Tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic