« Search JDeveloper Related Blogs Extension | Main | ODTUG - The JDevelopr Users Conference »

Enabling User Input When Running Classes Inside JDeveloper

Let's suppose you wrote a piece of Java code that needs some user input - and you used something like

String text = stdin.readLine();

Now you want to run or debug it inside JDeveloper, but how do you get JDeveloper to prompt you for the input value?

Here is the "secret trick":

Go into the project properties and edit the current Run/Debug Configuration.
Under the tools settings node you'll see that the last item allows you to specify "Allow Program Input"

input1:

check this box and run your project.

Now when you hit the input request look at your log window - just below it you'll see a little input field ready for your input:


input2:

Comments (2)

Seyi Adebajo:

Hi, I already know this method to take in program input, however when I want to input the end-of-file character (CTRL-C) in windows Jdeveloper refuses to accept any input.

How can I input the EOF in Jdeveloper?
Thanks.

Now this is a blog post I have to agree with. Your views are quite good. I'll be sure to subscribe :-)

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)