V
V
volverine2014-09-03 22:51:55
Java
volverine, 2014-09-03 22:51:55

How to do console input in Eclipse?

I use

BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

for reading, in general, when the program starts, it does not wait for input and a NullPointerException occurs,
ps just through the Windows console everything works fine. Maybe there is some feature in Eclipse?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DR_Demons, 2014-09-03
@DR_Demons

If you need to pass an argument when starting the program, you need to run the program through the menu Run > Run ... a window will open there, the second tab arguments and you need to add the argument you need there.

P
protven, 2014-09-04
@protven

Run the program in Eclipse. Further down, click on the Console tab. Type text there and press Enter. The answer from DR_Demons is suitable for passing parameters to the program at startup, not for interactive input.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question