DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page "Just My Code" in Eclipse?
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2008
Question "Just My Code" in Eclipse? - 01-27-2008, 08:49 PM

Hello,

I'm a new Eclipse user and I'm having trouble with the "Step Filtering" feature. It works fine while stepping through the code, but what I'm trying to figure out is how to prevent Eclipse from trying to find source code for the java library when an exception is thrown.

For instance, when I'm using Scanner.nextInt and I enter a letter instead of a number, I get an InputTypeMismatch exception. Rather than simply showing me my code after breaking for the exception, it opens up a new code window titled "Scanner.throwFor() line: not available [local variables unavailable]". The window is blank except for "Source not found." and a button that says "Edit Source Lookup Path". Of crouse, all I have to do is click the last place in the call stack that was in my code and I can see where the exception occured, but I'd like to prevent any new tabs/windows from opening up and have it point only in my code. This is similar to the "Just My Code" feature of Visual Studio.

I've done a lot of searching, reading through the help and looking through the debugger options but I've been unable to find the answer. Any ideas?

Thanks in advance,
Nate
Reply With Quote
  (#2 (permalink)) Old
Administrator
 
rick's Avatar
 
Posts: 52
Thanks: 8
Thanked 1 Time in 1 Post
Join Date: Jan 2008
Location: Cary, NC
Send a message via AIM to rick Send a message via MSN to rick Send a message via Yahoo to rick Send a message via Skype™ to rick
Default 01-27-2008, 10:38 PM

Quote:
Originally Posted by heavycrag View Post
I'm a new Eclipse user and I'm having trouble with the "Step Filtering" feature. It works fine while stepping through the code, but what I'm trying to figure out is how to prevent Eclipse from trying to find source code for the java library when an exception is thrown.
Hi Nate, and welcome to our brand new forums. Thanks for stopping by and asking this interesting question. If I understand it correctly, you're looking for a way to prevent source code searches outside of the classes actually in your own project?

I have seen debuggers throw up all kinds of stuff for library-level classes, so I can totally understand why you might want this. I'll be interested to learn the answer myself.

Rick
Reply With Quote
  (#3 (permalink)) Old
Member
 
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2008
Default 01-27-2008, 10:58 PM

Rick,

Your understanding is correct. :-) Thanks for your reply; I'm hoping there's some hidden option in Eclipse that I haven't seen yet! I'd be really surprised if no one else has encountered this before...

Oh, I forgot to mention that I'm using Eclipse 3.3.1.1 and JRE 1.6.

Nate
Reply With Quote
  (#4 (permalink)) Old
Moderator
 
Posts: 102
Thanks: 0
Thanked 7 Times in 7 Posts
Join Date: Jan 2008
Default 01-28-2008, 08:47 AM

Hi Nate

As far as I know, when an exception is thrown that will open up in a window when debugging.
I could be wrong, but you should be able to click back onto the main thread and see where it's going in your code.
Does this make sense to you?

James
Reply With Quote
  (#5 (permalink)) Old
Moderator
 
Posts: 102
Thanks: 0
Thanked 7 Times in 7 Posts
Join Date: Jan 2008
Default 01-28-2008, 11:35 AM

Hi Nate,
One other resource that may be useful to find out more about debugging in Eclipse : Eclipse And Java: Using the Debugger

James
Reply With Quote
  (#6 (permalink)) Old
Member
 
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2008
Location: Chicago Land Area, USA
Default 01-29-2008, 05:55 PM

Windows>Preferences-Java>Debuger

Make sure the open popup on exception box is unchecked




Quote:
Originally Posted by heavycrag View Post
Hello,

I'm a new Eclipse user and I'm having trouble with the "Step Filtering" feature. It works fine while stepping through the code, but what I'm trying to figure out is how to prevent Eclipse from trying to find source code for the java library when an exception is thrown.

For instance, when I'm using Scanner.nextInt and I enter a letter instead of a number, I get an InputTypeMismatch exception. Rather than simply showing me my code after breaking for the exception, it opens up a new code window titled "Scanner.throwFor() line: not available [local variables unavailable]". The window is blank except for "Source not found." and a button that says "Edit Source Lookup Path". Of crouse, all I have to do is click the last place in the call stack that was in my code and I can see where the exception occured, but I'd like to prevent any new tabs/windows from opening up and have it point only in my code. This is similar to the "Just My Code" feature of Visual Studio.

I've done a lot of searching, reading through the help and looking through the debugger options but I've been unable to find the answer. Any ideas?

Thanks in advance,
Nate
Reply With Quote
  (#7 (permalink)) Old
Administrator
 
rick's Avatar
 
Posts: 52
Thanks: 8
Thanked 1 Time in 1 Post
Join Date: Jan 2008
Location: Cary, NC
Send a message via AIM to rick Send a message via MSN to rick Send a message via Yahoo to rick Send a message via Skype™ to rick
Default 01-29-2008, 06:24 PM

Quote:
Originally Posted by fg82183 View Post
Windows>Preferences-Java>Debuger

Make sure the open popup on exception box is unchecked
Well done, Fred! Thanks!
Reply With Quote
  (#8 (permalink)) Old
Member
 
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2008
Default Please look at the screenshots - 01-29-2008, 08:58 PM

Quote:
Originally Posted by fg82183 View Post
Windows>Preferences-Java>Debuger

Make sure the open popup on exception box is unchecked
Thanks very much, but that was already unchecked. When it's checked it opens up a different popup. What I'm talking about is not really a popup, it's a new source code tab in the source code window. So, thanks for the idea, but that's not the answer.

I'd like it to jump back in the call stack and show the last spot in my code before the exception was thrown.

I've attached some screenshots that I think will be helpful. Please take a look.

UPDATE: Pay close attention to the filename (and therefore the URL) of the screenshots because they explain the purpose of the screenshot. Note the popup in one screenshot (which is not my problem) and in another screenshot there is a blank white tab that says "source code not found" (which is my problem).
Attached Images
File Type: jpg popup_checked.JPG (73.5 KB, 11 views)
File Type: jpg popup_unchecked.JPG (83.1 KB, 9 views)
File Type: jpg debug_settings.JPG (63.9 KB, 8 views)
File Type: jpg what_I_want.jpg (100.1 KB, 9 views)
Reply With Quote
  (#9 (permalink)) Old
Member
 
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2008
Default 01-29-2008, 09:07 PM

Quote:
Originally Posted by jsugrue View Post
Hi Nate

As far as I know, when an exception is thrown that will open up in a window when debugging.
I could be wrong, but you should be able to click back onto the main thread and see where it's going in your code.
Does this make sense to you?

James
Yes, what you say makes perfect sense. This is in fact what I do as a workaround. However, the step filtering settings should cause it to recognize that I do not want to step inside the code of the scanner (or any library) class, right? Why does it nonetheless try to show library code when an exception is hit?
Reply With Quote
  (#10 (permalink)) Old
Member
 
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2008
Default 01-29-2008, 09:33 PM

Quote:
Originally Posted by jsugrue View Post
Hi Nate,
One other resource that may be useful to find out more about debugging in Eclipse : Eclipse And Java: Using the Debugger

James
Unfortunately, after watching tutorial number 4, these videos don't seem to touch on my specific question. Thanks very much for posting the link though; it's great for people new to Eclipse like I am! I will review the other videos in detail to see if by chance they mention something about it.

Last edited by heavycrag; 01-29-2008 at 09:39 PM.
Reply With Quote
Reply

Tags
exceptions debugging

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If I want develop both php/java/c/c++ with "eclipse IDE", lse123 Eclipse 0 11-16-2008 05:01 PM
Eclipse CDT "An internal error occurred during: "Launching"" aluminumpork Eclipse 1 10-08-2008 05:48 AM
Eclipse Debug error - "Process Model Delta" bboyle18 Eclipse 2 09-02-2008 08:20 PM
eclipse rcp: removing "workbench user guide" in Help kerspe Eclipse 0 09-01-2008 04:01 AM
Error when launching Eclipse: In Project Explorer window: "Error creating the view" barbuceanu Eclipse 1 05-07-2008 01:41 PM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com