Download VS Code here: link
Build command for Windows:
{
"version": "2.0.0",
"tasks": [
{
"label": "Compile and run Java",
"type": "shell",
"command": "",
"args": [
"copy",
"\"${file}\"",
"${workspaceFolder}\\TempJavaProgram.java",
"&&",
"javac",
"TempJavaProgram.java",
"&&",
"java",
"TempJavaProgram",
"<",
"input.txt",
">",
"output.txt",
"&&",
"del",
"TempJavaProgram.class",
"&&",
"del",
"TempJavaProgram.java"
],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "java",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.*\\.java):(\\d+):\\s+(error):\\s+(.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
}
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "Compile and run Java",
"type": "shell",
"command": "",
"args": [
"cp",
"\"${file}\"",
"${workspaceFolder}/TempJavaProgram.java",
"&&",
"javac",
"TempJavaProgram.java",
"&&",
"java",
"TempJavaProgram",
"<",
"input.txt",
">",
"output.txt",
"&&",
"rm",
"TempJavaProgram.class",
"&&",
"rm",
"TempJavaProgram.java"
],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "java",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.*\\.java):(\\d+):\\s+(error):\\s+(.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
}
}
]
}