From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: [PATCH] bug fix in ob-groovy.el Date: Fri, 23 Feb 2018 18:16:50 -0500 Message-ID: <87606n9tzx.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epMaL-0004x4-6R for emacs-orgmode@gnu.org; Fri, 23 Feb 2018 18:17:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epMaK-0000MX-2G for emacs-orgmode@gnu.org; Fri, 23 Feb 2018 18:17:01 -0500 Received: from [195.159.176.226] (port=51601 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1epMaJ-0000GJ-Ob for emacs-orgmode@gnu.org; Fri, 23 Feb 2018 18:16:59 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1epMYE-00030e-GT for emacs-orgmode@gnu.org; Sat, 24 Feb 2018 00:14:50 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Replace-dash-by-underscore-in-temp-file-names.patch Content-Description: ob-groovy.el: replace '-' with '_' in temp file names >From a4b64486c8f527b04ae915dcc45a3a2ec43d8e62 Mon Sep 17 00:00:00 2001 From: Nick Dokos 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 --=-=-=--