emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How-to evaluate Java-snippets in org-mode/org-babel?


From: Eric Schulte
Subject: Re: [O] How-to evaluate Java-snippets in org-mode/org-babel?
Date: Wed, 06 Jul 2011 07:26:45 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

"Jason F. McBrayer" <address@hidden> writes:

> On Tue, 05 Jul 2011 10:07:19 +0100, Eric S Fraga wrote:
>> Torsten Wagner writes:
>>
>>> Hi all, I need to evaluate many small java snippets. I tried to do
>>> this
>>> in org-mode but so fare it didn't work out. org-babel seems to have
>>> no
>>> java support ?
>>
>> Not directly but, given the issues with class paths and naming
>> schemes,
>> I would suggest that the best route is to use babel to tangle code
>> instead of trying to execute it directly within org.
>
> My guess is that if you want to execute it directly within org, the
> thing to do is to run it in beanshell[1], like JDEE does. I'm not
> really familiar enough with org-babel to tell you how to go about
> doing that, though.
>
>
> [1] http://www.beanshell.org/

I think the first place to look for executing Java from Org-mode code
blocks would be to check if any existing Emacs java modes already
provide support for interactive code evaluation.  When possible
piggybacking off of existing support modes is generally the easiest
solution.

See org/ob-C.el for an example of how to execute a code block which
requires compilation before execution.  I've (thankfully) managed to
avoid using Java throughout my CS career, so I'm not overly familiar
with the execution mechanics.  There are numerous examples in the ob-*
files of languages which write code block bodies to external files and
then pass those files to executables.

beanshell looks like it may provide the best option for :session
evaluation, however if no inferior java mode currently exists I would be
hesitant to try to wrap beanshell directly.

Cheers -- Eric

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]