Hi, is it me or is there no way to take input from the user, with ex.
public class App {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("Hello " + s.nextLine());
}
}
There is no console to type input into ?
I've tried using the "console": "internalTerminal" and other's but it does not work with any of that, is it an limitation from this ext ?
@TheSinding currently the debug console doesn't support typing input yet.
But you can launch your java program manually in a standalone terminal.
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=1049 -cp ./bin YourMainClass
Then start the debug with attach mode.
{
"type": "java",
"name": "Java Debug (Attach)",
"request": "attach",
"hostName": "localhost",
"port": 1049
}
Arh okay, thanks!
@testforstephen can we support launching in the integrated terminal for this scenario?
@akaroml yes, the feature supportsRunInTerminalRequest provided by VSCode is exactly for this scenario.
It's fixed in 0.4.0. By changing console to integratedTerminal/externalTerminal in launch.json, it supports console input now.
@testforstephen thanks man.
Most helpful comment
It's fixed in 0.4.0. By changing
consoletointegratedTerminal/externalTerminalin launch.json, it supports console input now.