9

In some Java IDEs (BlueJ and DrJava, for example), the user can open an interaction window where Java expressions and statements can be typed in. The IDE quickly compiles and runs the code, displaying the returned value if necessary.

In BlueJ, it's called the Code Pad. It's similar in spirit to the Interaction Pane in DrRacket/DrScheme.

Does something like this exist for Eclipse?

Barry Brown
  • 19,087
  • 14
  • 65
  • 102

3 Answers3

9

You may be looking for Scrapbook pages. Here's a write-up and here are other SO questions which talk about it.

Community
  • 1
  • 1
Michael Brewer-Davis
  • 13,385
  • 5
  • 35
  • 48
8

There is also the Display View, which allows executing code while debugging. It's handy, because it evaluates in the context of the current stack frame.

sbridges
  • 24,059
  • 3
  • 60
  • 70
0

I know this is a pretty big necro, but I came upon this page while searching for the answer myself. Unfortunately, none of the above answers led me to figuring out how to do what I wanted easily. I found out how to do what I wanted to and decided to post here incase someone else learning Java got stuck the same way we did.

The 'Interactions Panel' in DrJava for i.e. allows you to write 'run programName 1 2 3' and 1 2 3 are the inputs for args[0]->args[2] and the program will then be ran.

To do this easily in Eclipse, click on the Run tab -> Run Configurations... -> Arguments tab -> Program Arguments -> type '1 2 3'. This will run your program with 1 2 3 as your inputs for your arguments.

Cheers.