emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Error running ditaa
@ 2010-11-23 14:27 Dov Grobgeld
  2010-12-13 19:45 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Dov Grobgeld @ 2010-11-23 14:27 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2461 bytes --]

When running ditaa on Linux fedora 12 through java, I get the following
errors:

java -jar /usr/share/java/ditaa.jar -r -S /tmp/org-ditaa27392h-V
blue_fd02b5c06d6a5cb80eaf27098c3c490dc81326ce.png
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/cli/ParseException
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.cli.ParseException
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
Could not find the main class:
org.stathissideris.ascii2image.core.CommandLineConverter. Program will exit.

This can be taken care of by using the shell script that comes with ditaa,
i.e.:

ditaa  -r -S /tmp/org-ditaa27392h-V

But to do this from within emacs I need to patch org-exp-blocks.el as
follows:

-    (unless (file-exists-p org-ditaa-jar-path)
-     (error (format "Could not find ditaa.jar at %s" org-ditaa-jar-path)))
:
-        (message (concat "java -jar " org-ditaa-jar-path " " args " "
data-file " " out-file))
-        (shell-command (concat "java -jar " org-ditaa-jar-path " " args " "
data-file " " out-file)))
+        (message (concat "ditaa " args " " data-file " " out-file))
+        (shell-command (concat "ditaa " args " " data-file " " out-file)))

(You also need to erase the checking for the existance of dita.jar)

Wouldn't it make more sense to replace the variable org-ditaa-jar-path with
a new variable org-ditaa-command that by default contains "java -jar
/old/value/of/org-ditaa-jar-path"? This would allow replacing it with a
shell script. Would a patch be accepted, or do you prefer to remain backward
compatible?

On a related question. Since there is quite a lot of common code between
org-export-blocks-format-dot and org-export-blocks-format-ditaa (especially
if my patch is accepted), wouldn't it make sense to create a
org-export-blocks-format-meta that take all the differences between the
various export-blocks as parameters? This would simplify adding additional
org-export-blocks.

Regards,
Dov

[-- Attachment #1.2: Type: text/html, Size: 4071 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Error running ditaa
  2010-11-23 14:27 Error running ditaa Dov Grobgeld
@ 2010-12-13 19:45 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2010-12-13 19:45 UTC (permalink / raw)
  To: Dov Grobgeld; +Cc: emacs-orgmode

Hi Dov,

I agree with your point that the ditaa and dot aspects of
org-export-blocks could be fruitfully refactored, however those parts of
org-export-blocks are nearly deprecated and are only retained for
backwards compatibility.

Please use code blocks [1] for a more interactive and powerful means of
evaluating and exporting dot and ditaa (and many other) blocks of code.

Thanks -- Eric

Dov Grobgeld <dov.grobgeld@gmail.com> writes:

> When running ditaa on Linux fedora 12 through java, I get the following
> errors:
>
> java -jar /usr/share/java/ditaa.jar -r -S /tmp/org-ditaa27392h-V
> blue_fd02b5c06d6a5cb80eaf27098c3c490dc81326ce.png
> Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/commons/cli/ParseException
> Caused by: java.lang.ClassNotFoundException:
> org.apache.commons.cli.ParseException
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
> Could not find the main class:
> org.stathissideris.ascii2image.core.CommandLineConverter. Program will exit.
>
> This can be taken care of by using the shell script that comes with ditaa,
> i.e.:
>
> ditaa  -r -S /tmp/org-ditaa27392h-V
>
> But to do this from within emacs I need to patch org-exp-blocks.el as
> follows:
>
> -    (unless (file-exists-p org-ditaa-jar-path)
> -     (error (format "Could not find ditaa.jar at %s" org-ditaa-jar-path)))
> :
> -        (message (concat "java -jar " org-ditaa-jar-path " " args " "
> data-file " " out-file))
> -        (shell-command (concat "java -jar " org-ditaa-jar-path " " args " "
> data-file " " out-file)))
> +        (message (concat "ditaa " args " " data-file " " out-file))
> +        (shell-command (concat "ditaa " args " " data-file " " out-file)))
>
> (You also need to erase the checking for the existance of dita.jar)
>
> Wouldn't it make more sense to replace the variable org-ditaa-jar-path with
> a new variable org-ditaa-command that by default contains "java -jar
> /old/value/of/org-ditaa-jar-path"? This would allow replacing it with a
> shell script. Would a patch be accepted, or do you prefer to remain backward
> compatible?
>
> On a related question. Since there is quite a lot of common code between
> org-export-blocks-format-dot and org-export-blocks-format-ditaa (especially
> if my patch is accepted), wouldn't it make sense to create a
> org-export-blocks-format-meta that take all the differences between the
> various export-blocks as parameters? This would simplify adding additional
> org-export-blocks.
>
> Regards,
> Dov
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Footnotes: 
[1]  http://orgmode.org/manual/Working-With-Source-Code.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-13 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-23 14:27 Error running ditaa Dov Grobgeld
2010-12-13 19:45 ` Eric Schulte

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).