'Why is my code not printing in the debug console?
I am new to coding and to Visual Studio Code so I am trying to teach myself how to use the program. I primarily want to code in Java and I have it set up correctly. The problem is that every time I try to run a basic program, it prints in the terminal but in the tutorial videos it prints in debug console. Has anyone had this problem and can anyone help me fix this?
/**
* Hello
*/
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
Solution 1:[1]
you could try to add "console": "internalConsole" in your launch.json like :
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - App",
"request": "launch",
"mainClass": "com.test.maven.App",
"console": "internalConsole",
"projectName": "my.app"
}
]
then it will show in Debug Console
Solution 2:[2]
- Go to your settings (ctrl + , | apple-key + , | by clicking on the Wheel Icon on the bottom left -> "Settings" | ctrl+p -> type in "settings")
- Search for "java.debug.settings.console".
- Change your default console to "internalConsole".
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Leo Zhu - MSFT |
| Solution 2 | Neifen |
