mlm mlm - 6 months ago 40
Java Question

Eclipse: How can I get the cursor to appear at the latest point in the console?

I'm using Eclipse to run the Java program below. When the program waits for the second line to be read, why does the cursor appear at the start of the line "Your first string is: "? How can I set the cursor to always appear at the latest point in the console?

public class Test {

public static void main(String[] args) throws IOException {
System.out.println("Enter first string: ");

BufferedReader br = new BufferedReader(new InputStreamReader(;
String enteredText = br.readLine();

System.out.println("Your first string is: " + enteredText);

System.out.println("Enter second string: ");
enteredText = br.readLine();

System.out.println("Your second string is: " + enteredText);


The standard eclipse console has various issues. You could try to use external console. Configuration of it has already been described well in this answer

In this case it may be simpler to run you program directly in the shell. You can use 'javac' command to compile and 'java' to run like this:

java Test