小鱼塘--自说自话的地方

  • 小玩意
  • 小想法
记录自己技术和想法地方
  1. 首页
  2. java
  3. 正文

vscode 设置java 设置控制台输出

6 5 月, 2024 1383点热度 0人点赞 0条评论
内容目录

背景

vscode启动java默认用的电脑自带控制台,这个清理日志不方便,清理之后前面几条很容易出现空白几行,同时没有颜色显示,用vscode 的debug console就没有这样子的问题

设置

  1. 创建启动配置,点击(Run and debug)按钮
  2. 点击创建启动json
  3. 在configurations中添加console 选择internalConsole即可

我的测试配置

···
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Current File",
"request": "launch",
"mainClass": "${file}",
"console": "internalConsole"
},
{
"type": "java",
"name": "Main",
"request": "launch",
"mainClass": "com.example.cc.Main",
"projectName": "demo"
}
]
}
···
"console": "internalConsole" 就是添加配置即可

总结

vscode配置确实非常方便,配置文件+界面提示设置其实也是非常方便,带有一定的自动化,基本可以用开发任何东西,这个真的非常方便。

标签: java vscode
最后更新:6 5 月, 2024

小鱼儿

爱研究技术,爱玩LOL

点赞

COPYRIGHT © 2022 小鱼塘. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

湘ICP备18005349号