Results 1 to 8 of 8
Like Tree1Likes
  • 1 Post By gimbal2

Thread: Error when trying to step into my code using F7 in NetBeans v8.0.2

  1. #1
    lordbyron is offline Member
    Join Date
    Jan 2015
    Posts
    1
    Rep Power
    0

    Question Error when trying to step into my code using F7 in NetBeans v8.0.2

    I am writing a program for a self taught Java class. The program uses a class I wrote for a previous assignment. The program is a variation of Blackjack, but instead of cards it uses two six sided dice. The previous class is called Die.class and the new program is called TwentyOne.class. When I press F7 to step into the code I get an error message that says: Source path java\lang\Boolean not found. The reason is likely no open project with this source file. When I press F7 the second time I get the same message, but the path is: sun\misc\launcher.java, and the third time I press F7 the path is changed to: twentyone\TwentyOne.java.

    Can someone shed some light on why this is happening? I need to step through the code to work out some problems with my code. http://www.java-forums.org/images/smilies/skype/@.gif

    I have also tried running the program with JGrasp v 2.0.1_01. I get a return code of 0, but nothing happens. JGrasp doesn't have step through option.

    Thanks in advance for any help.

    Lord Byron

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Error when trying to step into my code using F7 in NetBeans v8.0.2

    I use Eclipse as my IDE but I think I know what the problem is. You probably don't have the source code to the JDK classes so you can't step into the java.lang.Boolean class or other classes. Does pressing F7 continuously eventually get you back to your own code? If so, that should be sufficient since I doubt the internals of the JDK class libraries are where your coding problems exist.

    Regards,
    Jim
    Last edited by jim829; 01-29-2015 at 04:13 AM.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Error when trying to step into my code using F7 in NetBeans v8.0.2

    Moved from New to Java to NetBeans

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Error when trying to step into my code using F7 in NetBeans v8.0.2

    The main problem here is to learn to not to rely only on F7, which is "step into". Debugging is a dance of sometimes taking a "step over" and other times doing a "step into". You want to step over methods of standard JDK classes, its only your own code you're interested in.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Error when trying to step into my code using F7 in NetBeans v8.0.2

    Quote Originally Posted by gimbal2 View Post
    You want to step over methods of standard JDK classes, ...
    There's a setting for that (Tools -> Options -> Java -> Java Debugger -> Step Filters)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Error when trying to step into my code using F7 in NetBeans v8.0.2

    Now I wonder if Eclipse has something similar, quite useful.

    EDIT: yes it does.

    window -> preferences -> java -> debug -> step filtering
    Last edited by gimbal2; 01-29-2015 at 01:46 PM.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Error when trying to step into my code using F7 in NetBeans v8.0.2

    Quote Originally Posted by gimbal2 View Post
    window -> preferences -> java -> debug -> step filtering
    Interesting how when helping an OP, we end up helping ourselves. Didn't know about this either. Now I don't have to think about it (I just need to remember why I now can't step into the JDK).

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Error when trying to step into my code using F7 in NetBeans v8.0.2

    I find the "filter simple getters/setters" checkboxes the most useful to be honest. I mean normally when you have code like this:

    Java Code:
    doSomeEpicThing(object.getProperty1(), object.getProperty2());
    If you'd want to step into that you would first step into getPropery2(), then into getProperty1() and finally into doSomeEpicThing(). But now I can make the debugger simply skip the getProperty1() and getProperty2() calls without having to set another breakpoint inside doSomeEpicThing().

    Its the small things that end up being the biggest joys.
    Last edited by gimbal2; 01-29-2015 at 04:28 PM.
    DarrylBurke likes this.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Installing WebSphere Application Server step by step
    By manideep.d132 in forum Reviews / Advertising
    Replies: 0
    Last Post: 01-23-2012, 07:35 PM
  2. Replies: 1
    Last Post: 08-18-2011, 07:47 PM
  3. NetBeans - error in code?
    By Sparky in forum NetBeans
    Replies: 4
    Last Post: 02-03-2011, 02:51 AM
  4. EJB3 Message driven beans step-by-step guide
    By nix123456 in forum Enterprise JavaBeans (EJB)
    Replies: 3
    Last Post: 09-28-2009, 01:29 PM
  5. Step-by-Step Tutorial: Achieve RAD with Seam+Eclipse+Tomcat
    By Techieexchange in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 11-13-2007, 07:13 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •