Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Output not in the Ouput/Debug Panel rather Terminal in VSCode Java

I am trying to run Java Programs (beginner) in VS Code. Whenever I try to run the program, it runs in the Terminal Panel. Any way I can change it so the end result is always in the Output/Debug panel.

It makes things a lot easier and cleaner.

I have been looking on the forums and the VSCode site to see if someone has already answered this but it hasn't been yet.

like image 487
ShadowAhsan Avatar asked Dec 13 '22 10:12

ShadowAhsan


2 Answers

You might be using debugger for java as an extension. You can modify the extension settings within the extension manager. Look for Debugger for Java and press on the settings icon. A list will appear. Press extension settings. There you can change the console specification to what you want. Set it to internalConsole. Go back to your code and run. You will see that it will show up on the Debug Console instead of the integrated terminal.

like image 135
Mrk Avatar answered Jan 04 '23 23:01

Mrk


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

like image 35
Leo Zhu - MSFT Avatar answered Jan 05 '23 00:01

Leo Zhu - MSFT