25

I am trying to use plantuml add-ons on VSCode: there are several but none of them is working. In this eample I am using the plantUML add-on.

the extension I am using

My VSCode

As you can see on the second image the preview is blank.

Can you help me ?

Yannick Pezeu
  • 530
  • 1
  • 7
  • 12

6 Answers6

50

I had the same issue. My preview started working right after I installed the Java Runtime Environment (JRE).

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Bruno Habermann
  • 601
  • 4
  • 5
4

the solution is:

You can open the diagram by hitting ALT + D to preview the PlantUML diagram on Windows and Option key + D on Mac.

3

On windows, you can now use chocolatey:

choco install plantuml

You then have to restart VsCode for the previewer to properly work.

igiona
  • 31
  • 4
2

The answer is right, however there is another issue too. I am going to post here the other issue for anyone wandering, because that issue is not on stackoverflow.

If you find the error:

  • "No valid diagram found here!"

Than here are the answers:

In short:

  • As mentioned here, try to put the cursor somewhere between @startuml and @enduml, and then press ALT + D to open the preview. If the cursor is outside of the @startuml @enduml block, the "No valid diagrams found here!" error occurs.
Laszlo
  • 302
  • 1
  • 10
1
  1. Download Java Runtime . Click "Instructions"

  2. Install graphviz

sudo apt update
sudo apt install graphviz
  1. Enjoy
0

If you use plantUML on VSCode with WSL remote, try this :

sudo apt install plantuml
arthurg
  • 1
  • 1
  • An alright alternative, but OP is asking about the VS Code extension. – ryanwebjackson Jun 17 '23 at 14:17
  • this answer solved the problem in a round-about way by installing java if it isn't already installed. The accepted answer is a more direct solution. The VSCode extension comes bundled with the `plantuml.jar` so it isn't necessary to install it at a system level – crypdick Aug 01 '23 at 20:56