KaliLinux 2018.2: Install PlantUML for UML tool

This article will describe installing PlantUML which creates UML diagram from text file. Atom, Eclipse and Emacs have a module for PlantUML.

1 Install PlantUML

Install plantuml.jar to /opt/plantuml.

#!/bin/sh -e


sudo apt install -y graphviz default-jre

sudo mkdir -p /opt/plantuml
cd /opt/plantuml
UML=http://sourceforge.net/projects/plantuml/files/plantuml.jar/download
sudo curl -JLO ${UML}

cat <<EOF | sudo tee /usr/local/bin/plantuml
#!/bin/sh

java -jar /opt/plantuml/plantuml.jar "\$@"
EOF
sudo chmod a+x /usr/local/bin/plantuml

2 Create UML diagram

Create sequence.png from sequence.pu.

#!/bin/sh

cat <<EOF > sequence.pu
@startuml
Alice -> Bob: test
@enduml
EOF
plantuml sequence.pu

0001_plantuml.png