VSCode下plantuml环境搭建

最近在准备系统架构设计师考试,其中涉及一些UML图。之前使用的vscode/markdown/marmaid无法显示复杂的图表,所以考虑使用PlantUML。

问题

使用VSCode创建markdown文件并添加plantuml语句,预览的时候报错

1
2
3
4
5
6
7
8
9
Error: plantuml.jar file not found: ""

Please download plantuml.jar from https://plantuml.com/download.


If you are using VSCode or coc.nvim, then please set the setting "markdown-preview-enhanced.plantumlJarPath" to the absolute path of plantuml.jar file.

If you don't want to use plantuml.jar, then you can use the online plantuml server
by setting the setting "markdown-preview-enhanced.plantumlServer" to the URL of the online plantuml server, for example: https://kroki.io/plantuml/svg/

报错

也就是说plantuml需要离线jar包或者在线服务支持。

环境

根据他的要求设置plantuml环境。打开VSCode设置搜索plantuml

设置

注意看括号里面的内容,需要java8+环境

在线服务

网上基本上找不到什么有效的在线服务,官网提供的服务太卡。所以,只能用离线包了。

离线包

官方源码仓库或者官网下载一个20M的jar包。

安装Java17并设置系统环境变量。

官方提供了许多版本,比如gpl/gplv2/mit/bsd等等,不知道用什么区别就选了第一个。当前版本是1.2025.2

效果


VSCode下plantuml环境搭建
https://blog.jackeylea.com/vscode/how-to-setup-vscode-plantuml-env/
作者
JackeyLea
发布于
2025年4月14日
许可协议