Get error message "Failed to evaluate. Reason: Cannot evaluate because the thread is resumed" after getting input from vscode debug console using BufferedReader in Java.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class demo {
public static void main(String args[]) throws IOException {
int input;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
input = br.read();
}
catch(IOException e) {
e.printStackTrace();
}
if(br != null) br.close();
System.out.println("123"); // would not execute using debug console in vscode.
}
}
Here is the launch.json, which is basically a default one.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "compile",
"mainClass": "demo",
"request": "launch",
"args": ""
}
]
}

Environment
- Operating System: Elementary OS 0.4.1 Loki Built on "Ubuntu 16.04.3 LTS"
- JDK version: java 9.0.1
- Visual Studio Code version: 1.18.0
- Java extension version: 0.14.0
Steps To Reproduce
- A console Java program getting user input with BufferedReader.
- start debugging on debug console
Current Result
Expected Result
Additional Informations
Get error message "Failed to evaluate. Reason: Cannot evaluate because the thread is resumed" after getting input from vscode debug console using BufferedReader in Java.
Here is the
launch.json, which is basically a default one.Environment
Steps To Reproduce
Current Result
Expected Result
Additional Informations