[provide a description of the issue]
What I'd like to do is to read input file in java as stdin by using "args" command in launch.json.
```Java : Main.java
import java.util.*;
public class Main{
public static void main (String args[]){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
}
}
###### launch.json
```Json:launch.json
{
"type": "java",
"name": "Debug (Launch) - Current File",
"request": "launch",
"mainClass": "${file}",
"projectName": "java_project",
"args": [
"<",
"src/stdin.txt"
],
"console": "integratedTerminal"
}
121
[attach a sample project reproducing the error]
[attach logs](https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting#enable-logging)
This configuration in Java Debugger v0.21.0 brings an NoSuchElementException. Main.java reads the input file stdin.txt, but no characters in that file.
Has no exceptions.
java Main.java < src/stdin.txt does work well.Thanks for reading.
In 0.21.0, we changed the default console to integratedTerminal, and introduced a launcher.bat to fix the encoding issue. Looks like the bat script eats the "< src/stdin.txt" args.
Currently a workaround is to escape the special character < in launch.json manually.
^< instead.\^\< instead.Hello,
I have been facing the same doubt, could you please provide more detail on how is the call being made after the sucessfull modification? So I can try to understand what is my mistake?
For instance mine is
c: && cd c:\Users\UserName\Documents\01_UFU_local\07_algoritmo\2021_1\test\testing && cmd /C "c:\Users\UserName.vscode\extensions\vscjava.vscode-java-debug-0.32.0\scripts\launcher.bat "C:\Program Files\Java\jdk-15.0.2\bin\java.exe" -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:59610 --enable-preview -XX:+ShowCodeDetailsInExceptionMessages -Dfile.encoding=UTF-8 @C:\Users\UserName\AppData\Local\Temp\cp_ap8myj75dr7wcc3936mshu66a.argfile Main < src/stdin.txt "
Many thanks
Most helpful comment
Currently a workaround is to escape the special character
<in launch.json manually.^<instead.\^\<instead.