Org-babel Java error

As said in Java Source Code Blocks in Org Mode, I did (setopt org-babel-default-header-args:java '((:dir . nil) (:results . value))). However, when doing C-c C-c on Java source blocks, I get an error: Symbol's value as variable is void: value.

I’m not sure what I’m doing wrong. When I set org-babel-default-header-args:java back to nil, my Java source blocks work fine, but then it’s with the default Java options but I want to change them.

Why not use nconc as in the documentation instead of setopt?

I tried this but it did not work. It duplicated the values in org-babel-default-header-args:java so it was '((:dir) (:results . value) (:dir) (:results . value))).

My Emacs (version 29.4) has the default value of org-babel-default-header-args:java:
((:results . "output") (:dir . ".")). Perhaps you should surround value with double quotation marks to make it a string value? The error message says there is no variable named value, and the document you refer to seems to talk about value and output.

I don’t use org-babel and program in Java, so I can be completely off the mark here, but worth a try. If this does not work for you, you may like to ask the question in Reddit or directly in Org’s dev-mailinglist. It’s possible documentation is obsolete now.

Thank you, will try.

That works, seems documentation is missing "" marks then.

1 Like