简体   繁体   English

如何在运行 java 文件时摆脱 VS Code 的终端 window 中显示的额外消息?

[英]How to get rid of the extra messages that show up in terminal window of VS Code while running java file?

Recently I have installed VS code and downloaded the coding pack for JAVA.最近安装了VS code,下载了JAVA的编码包。 But when I ran a hello world printing code I saw lots of other information that where displayed in the terminal window.但是当我运行 hello world 打印代码时,我看到了许多其他信息,这些信息显示在终端 window 中。 How do I prevent this from happening.我该如何防止这种情况发生。 The image below explains my problems:下图解释了我的问题: 在此处输入图像描述

I want to get rid of these messages and print hello world only我想摆脱这些消息并只打印 hello world

There're no such settings for disabling execution scripts in Terminal , but we have some workaround.Terminal中没有用于禁用执行脚本的此类设置,但我们有一些解决方法。

1.Create launch.json and set "console": "internalConsole", . 1.创建launch.json并设置"console": "internalConsole", ,. Then Run without Debugging , the result will be shown in Debug Console and no execution scripts:然后Run without Debugging ,结果将显示在Debug Console中并且没有执行脚本:

在此处输入图像描述

2.In launch.json , set "console": "externalTerminal", . 2. launch.json中,设置"console": "externalTerminal", ,。 Then Run without Debugging , the result will be shown in external Terminal and no execution scripts:然后Run without Debugging ,结果将显示在外部终端并且没有执行脚本:

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM