The problem was reported in

   https://stackoverflow.com/questions/48893994/groovy-in-org-mode-babel

I reproduced the problem locally. The basic error message is

  Caught: java.lang.ClassFormatError: Illegal class name 
"groovy-31624d60$isGolden"

The problem is the dash.

The patch replaces dashes with underscores when constructing temp file
names.

-- 
Nick

>From a4b64486c8f527b04ae915dcc45a3a2ec43d8e62 Mon Sep 17 00:00:00 2001
From: Nick Dokos <ndo...@redhat.com>
Date: Fri, 23 Feb 2018 17:58:27 -0500
Subject: [PATCH] Replace dash by underscore in temp file names.

* org-babel-groovy-evaluate: replace '-' by '_' in temp file names.

Apparently, the JVM uses file names in the construction of names of internal
objects and dashes are illegal in that context. See

   https://stackoverflow.com/questions/48893994/groovy-in-org-mode-babel

for an example.
---
 lisp/ob-groovy.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-groovy.el b/lisp/ob-groovy.el
index 67e7562fb..565b09754 100644
--- a/lisp/ob-groovy.el
+++ b/lisp/ob-groovy.el
@@ -84,12 +84,12 @@ in BODY as elisp."
   (when session (error "Sessions are not (yet) supported for Groovy"))
   (pcase result-type
     (`output
-     (let ((src-file (org-babel-temp-file "groovy-")))
+     (let ((src-file (org-babel-temp-file "groovy_")))
        (progn (with-temp-file src-file (insert body))
               (org-babel-eval
                (concat org-babel-groovy-command " " src-file) ""))))
     (`value
-     (let* ((src-file (org-babel-temp-file "groovy-"))
+     (let* ((src-file (org-babel-temp-file "groovy_"))
             (wrapper (format org-babel-groovy-wrapper-method body)))
        (with-temp-file src-file (insert wrapper))
        (let ((raw (org-babel-eval
-- 
2.14.3

Reply via email to