canellas
canellas

Reputation: 697

Failing to execute plantuml in emacs

I am using GNU Emacs 25.3.1 (x86_64-w64-mingw32), on Windows 10, plantuml 1.4.1, and the following .emacs:

(package-initialize)

(require 'package)
(add-to-list 'package-archives
             '("MELPA Stable" . "http://stable.melpa.org/packages/") t)

(custom-set-variables
 '(package-selected-packages (quote (plantuml-mode ## flycheck company)))
 '(plantuml-default-exec-mode (quote jar))
 '(plantuml-jar-path "C:\\Users\\tc000210\\AppData\\Roaming\\plantuml.jar"))

I execute plantuml-mode, and when I try plantuml-preview on this PlantUML code:

@startuml
A *-- B
@enduml

I get the message error in process sentinel: PLANTUML preview failed: exited abnormally with code 1

Does anyone know how to fix this?

Thanks!

Upvotes: 4

Views: 1472

Answers (2)

Gangula
Gangula

Reputation: 7294

Other than plantuml-mode, you can also try out wsd-mode.

Compared to plantuml-mode, its support for syntax-highlighting and indentation is clearly and objectively superior. It also integrates nicely with flycheck (for code syntax checking) and company-mode (for completions).

Unlike plantuml-mode, it doesn't depend on Java or other binaries, but instead uses a SaaS webservice to generate the diagrams.

But, it might end up not working in the future if the website becomes unavailable.

Reference: https://emacs.stackexchange.com/a/5557/36093

Upvotes: 0

Richard Gomes
Richard Gomes

Reputation: 6094

This is my configuration on Debian Buster with Java11. You need to replace the path on plantuml-jar-path.

(use-package plantuml-mode
  :init
    (setq plantuml-default-exec-mode 'jar)
    (setq plantuml-jar-path "/usr/share/plantuml/plantuml.jar")
    (setq org-plantuml-jar-path (expand-file-name "/usr/share/plantuml/plantuml.jar"))
    (setq org-startup-with-inline-images t)
    (add-to-list 'org-src-lang-modes '("plantuml" . plantuml))
    (org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t))))

Upvotes: 4

Related Questions