Create and run code in Scrapbook page

Creating a Java scrapbook page

The scrapbook allows Java expressions, to be run, inspected, and displayed under the control of the debugger. Breakpoints and exceptions behave as they do in a regular debug session.

Code is edited on a scrapbook page. A VM is launched for each scrapbook page in which expressions are being evaluated. The first time an expression is evaluated in a scrapbook page after it is opened, a VM is launched. The VM for a page will remain active until the page is closed, terminated explicitly (in the debugger or via the Stop the Evaluation button in the editor toolbar), or when a System.exit() is evaluated.

There are several ways to open the New Java Scrapbook Page wizard.

Once you've opened the New Java Scrapbook Page wizard:

New Java Scrapbook Page wizard

  1. In the Enter or select the folder field, type or click Browse to select the container for the new page.

  2. In the File name field, type a name for the new page. The .jpage extension will be added automatically if you do not type it yourself.

  3. Click Finish when you are done. The new scrapbook page opens in an editor.

Executing an expression

Executing an expression evaluates an expression but does not display a result.

If you select the expression to execute and click the Execute button in the toolbar, no result is displayed, but the code is executed.

Type AND highlight System.out.println("Hello World"), and click the Execute button:

Execute

The Hello World appears in the Console view, but no result is displayed in the scrapbook editor or the Expressions view:

Console

Professional hosting     Belorussian informational portal         Free SCBCD 1.3 Study Guide     Free SCDJWS 1.4 Study Guide     SCDJWS 1.4 Quiz     Free IBM Certified Associate Developer Study Guide     Free SCJP 5.0 (Tiger) Study Guide     Free Mock Exam Engine     Free SCWCD 1.4 Study Guide     IBM Test 000-287. Enterprise Application Development with IBM WebSphere Studio, V5.0 Study Guide