I am trying to debug Java code which is only hello world program.
public class Hello
{
public static void main(String[] args)
{
System.out.println("hello world");
}
}
The code above has no error. But Visual Studio Code keeps warning this message to me even though the code has no error. But every time when I click Proceed, Visual Studio Code can debug Java code successfully.
I don't really know which build is failed.
And this is my launch.json for Java debugger. Did I set it up correctly?
{
"type": "java",
"name": "Java",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"stopOnEntry": false,
"mainClass": "Hello",
"args": ""
},
In the mainClass
, I can just use "mainClass": "Hello"
as usual to debug Java code after saving the file as Hello.java
, and use javac Hello.java
to build Hello.class
.
I really don't know which build is failed or if it is a bug in Java debugger.
Could you please help me fix this problem?