3

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!

canellas
  • 491
  • 5
  • 17
  • FWIW, it works fine on Linux (Fedora 31). Can you process the file from the command line? The [PlantUML documentation](https://plantuml.com/command-line) has forward slashes for the jar path even on Windows - maybe try that? – NickD Jan 22 '20 at 18:56
  • Yes, executing from the command line works fine.So, the issue seems at Emacs. May be if I try something different in the configuration? – canellas Jan 23 '20 at 17:56
  • I would try setting `plantuml-jar-path` to `"C:/Users/tc000210/AppData/Roaming/plantuml.jar"` using forward slashes: I believe emacs does the right thing with that even on Windows (but what I know about Windows is pretty close to nil). – NickD Jan 23 '20 at 18:15
  • @NickD, thanks for the tip, but it did not work either. I set the path as you suggested to `"C:/Users/tc000210/AppData/Roaming/plantuml.jar"`, but I got `Writing to process: Invalid argument, PLANTUML` – canellas Jan 29 '20 at 14:21

1 Answers1

3

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))))
Richard Gomes
  • 5,675
  • 2
  • 44
  • 50