From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: [babel] ob-java error org-babel-execute-src-block: Wrong type argument: characterp, "-cp ." Date: Tue, 7 Aug 2012 17:17:42 +0900 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Syez8-0008JM-9a for emacs-orgmode@gnu.org; Tue, 07 Aug 2012 04:17:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Syez1-0007VF-QD for emacs-orgmode@gnu.org; Tue, 07 Aug 2012 04:17:50 -0400 Received: from mail-vc0-f169.google.com ([209.85.220.169]:35592) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Syez1-0007V8-LS for emacs-orgmode@gnu.org; Tue, 07 Aug 2012 04:17:43 -0400 Received: by vcbfl10 with SMTP id fl10so4305588vcb.0 for ; Tue, 07 Aug 2012 01:17:43 -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: Org Mode Mailing List Hi all, every year I want like to evaluate java snippets in org-mode to evaluate courseworks. This worked fine but recently I had a bigger data crash and re-setup my office machine. It worked ok for the crash (that is it worked ok for the set-up at that time). I use now GNU Emacs 24.1.1 Org-mode version 7.8.11 I can evaluate simpler blocks but for more complex once I run into trouble I used #+BABEL: :mkdirp t #+BABEL: :cmpflag -cp . #+BABEL: :cmdline -cp . #+begin_src emacs-lisp (setq org-babel-default-header-args:java '((:cmpflag "-cp .") (:cmdline "-cp ."))) #+end_src ** CODE-TESTER #+BEGIN_SRC java :classname enshu4/Shop4Tester package enshu4; public class Shop4Tester { public static void main(String[] args) { System.out.println("----------Checking for list 1---------"); Shop4 shop1 = new Shop4("item1.txt"); shop1.print("potato"); shop1.printAllNames(); System.out.println("\n----------Checking for list 2----------"); Shop4 shop2 = new Shop4("item2.txt"); shop2.print("potato"); shop2.printAllNames(); } } #+END_SRC ** studentID #+BEGIN_SRC java :classname enshu4/Shop4 package enshu4; import java.util.Hashtable; import java.util.Iterator; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.FileNotFoundException; public class Shop4 { private Hashtable item; public void printAllNames() { String tes; Iterator it = item.keySet().iterator(); while (it.hasNext()) { tes = it.next(); System.out.println(tes + " a " + item.get(tes) + "Euro"); } } public Shop4(String fname) { item = new Hashtable(); FileReader fr; try { fr = new FileReader(fname); } catch (FileNotFoundException e) { System.out.println(fname + "not found"); return; } BufferedReader br = new BufferedReader(fr); String line; try { while ((line = br.readLine()) != null) { String target = line; String[] splt = target.split("="); String key = splt[0]; String val = splt[1]; item.put(key,new Integer(val)); } br.close(); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) { Shop4 shop = new Shop4("item.txt"); shop.printAllNames(); } } #+END_SRC If I want to execute the given source code block I end up with an error message org-babel-execute-src-block: Wrong type argument: characterp, "-cp ." I believe this is rather common due to some changes within emacs, but I can't find a way to get around this. Any idea? BTW. previous year it seems I created the lists by #+BEGIN_SRC text :tangle ./item1.txt potato=120 bread=160 milk=180 #+END_SRC but this seems not to work anymore.... anyhow that would be a minor problem Thanks for looking into this. Torsten