Inspect your code in Eclipse using Eclipse Scrapbook feature

The java IDEs (eclipse, IRAD etc) contribute a scrapbook facility that can be used to try and evaluate Java expressions (such as code snippets). Java scrapbook errors are shown in the editor. Snippets are edited and evaluated in the Scrapbook page editor. In the editor you can select a code snippet, evaluate it, and display the result as a string in console.

Creating a Java Scrapbook Page

The scrapbook allows Java expressions, to be run, inspected, and displayed, under the control of the debugger. Exceptions are shown in the scrapbook itself.

A VM is launched for each scrapbook page in which expressions are being evaluated. The first time an expression is evaluated in a scrapbook, 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 console), or when a System.exit() is evaluated.

  1. From the workbench window, do one of the following:
    • From the drop-down File menu ,click on the New button, select Other. Then select Java ->Java Run/Debug -> Scrapbook Page. Then click Next.
    • Enter any file name.
  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. Your jpage is ready to use. You can add java code snippets and select them and run them directly.

Share
Published by
Kiran Hegde
Tags: eclipse eclipse feature eclipse scrapbook How-To Java

Recent Posts

  • Java

Java URL Encoder/Decoder Example

Java URL Encoder/Decoder Example - In this tutorial we will see how to URL encode/decode…

4 years ago
  • General

How to Show Multiple Examples in OpenAPI Spec

Show Multiple Examples in OpenAPI - OpenAPI (aka Swagger) Specifications has become a defecto standard…

4 years ago
  • General

How to Run Local WordPress using Docker

Local WordPress using Docker - Running a local WordPress development environment is crucial for testing…

4 years ago
  • Java

Create and Validate JWT Token in Java using JJWT

1. JWT Token Overview JSON Web Token (JWT) is an open standard defines a compact…

4 years ago
  • Spring Boot

Spring Boot GraphQL Subscription Realtime API

GraphQL Subscription provides a great way of building real-time API. In this tutorial we will…

4 years ago
  • Spring Boot

Spring Boot DynamoDB Integration Test using Testcontainers

1. Overview Spring Boot Webflux DynamoDB Integration tests - In this tutorial we will see…

5 years ago