The code below evaluated successfully but ~/Downloads/foo.png is empty. A look at the downloads folder shows that no file has been generated. What went wrong?
#+begin_src ditaa :file ~/Downloads/foo.png
+--------+ +-------+ +-------+
| | --+ ditaa +--> | |
| Text | +-------+ |diagram|
|Document| |!magic!| | |
| {d}| | | | |
+---+----+ +-------+ +-------+
: ^
| Lots of work |
+-------------------------+
#+end_src
#+results:
[[file:~/Downloads/foo.png]]
The same diagram, when ditaa
is called from terminal, produces an output in 6 secs.
ditaa diagram.txt sample.png
ditaa version 0.11, Copyright (C) 2004--2017 Efstathios (Stathis) Sideris
Running with options:
Reading file: diagram.txt
Rendering to file: sample.png
Done in 6sec
ORG version
*Messages*
executing Ditaa code block...
java -Dfile.encoding=UTF-8 -jar /usr/local/bin/ditaa /var/folders/rw/rpr418x91h13ysbc6k7fzj240000gn/T/babel-6iUieC/ditaa-lD3wxu /Users/satibodhi/Downloads/foo.png
Error: Invalid or corrupt jarfile /usr/local/bin/ditaa
Code block evaluation complete.
Seems like this has something to do with homebrew
aliasing java -jar ditaa.jar
to ditaa
.
$ ditaa
usage: java -jar ditaa.jar <INPFILE> [OUTFILE] [-A] [-b <BACKGROUND>] [-d]
[-E] [-e <ENCODING>] [-h] [--help] [-o] [-r] [-S] [-s <SCALE>]
[--svg] [--svg-font-url <FONT>] [-T] [-t <TABS>] [-v] [-W]
M-x org-version
will give you that information). Does your*Messages*
buffer show anything suspicious?org-ditaa-jar-path
to point to the jar that is working. What does/usr/local/bin/ditaa
look like?../Cellar
path.$ ls -la ditaa lrwxr-xr-x 1 satibodhi admin 32 Jun 21 04:41 ditaa -> ../Cellar/ditaa/0.11.0/bin/ditaa
. This is not a jar file either./var/folders/rw/rpr418x91h13ysbc6k7fzj240000gn/T/babel-6iUieC/ditaa-lD3wxu
This portion of the executed code seems weird to me.