From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: How-to evaluate Java-snippets in org-mode/org-babel? Date: Wed, 06 Jul 2011 07:26:45 -0600 Message-ID: <87hb6z5xxr.fsf@gmail.com> References: <4E12B6DB.4090001@gmail.com> <87tyb1jdtk.fsf@pinto.chemeng.ucl.ac.uk> <60823cb60ff097c37ecd62f5c9865914@marie.carcosa.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeSLz-000764-Ud for emacs-orgmode@gnu.org; Wed, 06 Jul 2011 09:41:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QeSLx-0002Oj-H9 for emacs-orgmode@gnu.org; Wed, 06 Jul 2011 09:41:23 -0400 Received: from mail-gy0-f169.google.com ([209.85.160.169]:44400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeSLx-0002Od-5g for emacs-orgmode@gnu.org; Wed, 06 Jul 2011 09:41:21 -0400 Received: by gyg13 with SMTP id 13so3240390gyg.0 for ; Wed, 06 Jul 2011 06:41:20 -0700 (PDT) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Jason F. McBrayer" Cc: Org Mode Mailing List "Jason F. McBrayer" 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/