*
The moose likes IDEs, Version Control and other tools and the fly likes Run a Program until specified line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Run a Program until specified line" Watch "Run a Program until specified line" New topic
Author

Run a Program until specified line

Roger Fed
Ranch Hand

Joined: Oct 17, 2010
Posts: 82

Hello, I've one Question about using NetBeans.
How can i run my program until specified line ???
thanks in advance.

I Hear I Forget, I See I Remember, I Do I Understand.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

You can set a breakpoint on the line that you want the debugger to stop, and then run the program in debug mode.

Put the cursor on the line, then select Debug / Toggle Line Breakpoint (Ctrl + F8). Then, to run it, select Debug / Debug Project or Debug File (if the file contains the main() method). The program will stop in the debugger when the line is reached, and then you can step through it, looking at the values of variables, or let it continue running.

Have a look at: NetBeans Debugger - Short Tutorial.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Roger Fed
Ranch Hand

Joined: Oct 17, 2010
Posts: 82

Thanks very much for your help and your valuable link.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Run a Program until specified line