We do not have enough information, so we would like to check various things, and we will list the possible errors and solutions.
"Also, if you write down the contents displayed on the debug console, it will be completed immediately, so if you write down the message that appears with ""Build failed"", we can solve it more simply."
○Confirmation
What happens if I compile on a console without using VSCode?
The steps are as follows (for Windows):
○Expected Error Cause No. 1 (Mistake Path)
Please allow me to check the settings as well.
Is it okay to set the PATH for JDK below?
"java.home": "C:\\Program Files\\Java\jdk-11.0.2"
Windows For Windows, you need to write two delimiters: \.
*You don't need to write up to bin
JR It should be JDK's PATH, not JRE's PATH.
○Expected error cause No.2 (filename and class name do not match)
Java must match the file name and class name.
If the filename is Hoge.java, the class name is Hoge.
You could do it below, so compare it to your situation.
"java.home": "C:\\Program Files\\Java\jdk-11.0.2"
public class Hoge{
public static void main(String[]args) {
System.out.println("test");
}
}
© 2024 OneMinuteCode. All rights reserved.