X

Shay Shmeltzer's Oracle Development Tools Tips

  • February 21, 2008

Enabling User Input When Running Classes Inside JDeveloper

Shay Shmeltzer
Director of Product Management - Oracle

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:

Join the discussion

Comments ( 15 )
  • Seyi Adebajo Monday, July 7, 2008
    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.
  • sore foot Monday, September 15, 2008
    Now this is a blog post I have to agree with. Your views are quite good. I'll be sure to subscribe :-)
  • kate Monday, April 18, 2011
    hey thanks for the userful info
  • Mohamed Shahpoup Tuesday, August 23, 2011

    thanks, you helped me in a lot of java tricks and java Problems that faces me specially when the problem in JDeveloper.

    thanks again


  • guest Thursday, December 1, 2011

    Thank you. This is and very good trick.


  • guest Saturday, May 26, 2012

    Very useful, thanks.


  • guest Friday, August 3, 2012

    Thanks for great info..


  • guest Thursday, July 11, 2013

    Thanks a lot for the great info


  • guest Monday, December 9, 2013

    Hi, the trick is good but I recently installed jDeveloper 12c and although I did what you said above I still can not write in the input line. Once I enable "Allow user input" the input line appears but I can't write in it. I can not position the cursor inside it. Can you help?


  • Shay Monday, December 9, 2013

    There is a bug in 12c that we are aware off.

    See discussion here:

    https://forums.oracle.com/message/11167674#11167674

    Someone reported a workaround there:

    "check autoscroll option > actions > log windows:


  • guest Tuesday, May 27, 2014

    Thank you.


  • ddennysc Thursday, October 23, 2014

    mil gracias.


  • guest Thursday, December 11, 2014

    C:\Oracle\Middleware\jdk160_24\bin\javaw.exe -client -classpath C:\JDeveloper\mywork\Application7\.adf;C:\JDeveloper\mywork\Application7\Project1\classes;C:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar -Djavax.net.ssl.trustStore=C:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks -Dhttp.proxyHost=localhost -Dhttp.proxyPort=8099 -Dhttp.nonProxyHosts=~localhost -Dhttps.proxyHost=localhost -Dhttps.proxyPort=8099 -Dhttps.nonProxyHosts=~localhost project1.Class1

    Process exited with exit code 0.

    I couldn't run the java program. it is not taking input values at the output. so how to resolve this problem,


  • Vamsi Sunday, October 18, 2015

    Thank you,nice useful information.


  • ang Tuesday, February 20, 2018
    nice
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.