From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4LfAM/j7r1+2JAAA0tVLHw (envelope-from ) for ; Sat, 14 Nov 2020 15:47:04 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id bL6qL/j7r18VLgAA1q6Kng (envelope-from ) for ; Sat, 14 Nov 2020 15:47:04 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2A8469401BE for ; Sat, 14 Nov 2020 15:47:04 +0000 (UTC) Received: from localhost ([::1]:33996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdxlX-0000S2-6O for larch@yhetil.org; Sat, 14 Nov 2020 10:47:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdxkx-0000Rd-8Z for emacs-orgmode@gnu.org; Sat, 14 Nov 2020 10:46:27 -0500 Received: from mail-ej1-f67.google.com ([209.85.218.67]:37837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdxkt-0001hq-SA for emacs-orgmode@gnu.org; Sat, 14 Nov 2020 10:46:26 -0500 Received: by mail-ej1-f67.google.com with SMTP id f20so18195932ejz.4 for ; Sat, 14 Nov 2020 07:46:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ioX04usC0B/JeZXmWOdJ56YJPV7dQ9v8YdFE0J24ylo=; b=kFm5KFfuB2bfvWcoGRVrnOEGX2kl6kUFYeZVVyuVpuSRKw4fOj1kcbgnPGUTs4hCnS m8nB8TEkHQeEvDZr18as/zmY+ev26Riw2SRl8WLjUnp0Ti4eF7kxI9Bixp39QUv5lsR7 0e2GdFJioqjmyGLaFSIvkTiqDO1v+3NzHA/pdSMzlGyXwJCiv+23jdX/pCDOZ2hmXJOI zkPl26ad+T5bxy5yAj0SvRa7hXYVVubpvE8147LTNdswkttrX6+sIt4izDMBRqYXx0xt em55JDwafiYLtp9utmGnukDXGENT8HLE4wTm8svwACuYPPEuHiXQ5RFV2NgS22nTRHHd vI7w== X-Gm-Message-State: AOAM530G/TbT+1t9Gj3Pz/8jVBd7MRSI1OlyypacYdzp9pivpXEMSV4N 9zMl87KT3I+A6nyWyYYI1V9XV1HBaEyQ2cK725EY2v6+rt0TPw== X-Google-Smtp-Source: ABdhPJyEw6H2sZqR0Nt0U4840yMFqNhwCXjPNPXoQ+g6gpzdshzwrF2AnqZ7PZQE/glg9kPHOFJm4UVALvOkSeyO0QY= X-Received: by 2002:a17:906:31cb:: with SMTP id f11mr6952595ejf.142.1605368782282; Sat, 14 Nov 2020 07:46:22 -0800 (PST) MIME-Version: 1.0 References: <87y2jv367k.fsf@kyleam.com> <87v9ez2flk.fsf@kyleam.com> <87361nwyvg.fsf@iki.fi> <87y2jfukky.fsf@iki.fi> <87imadafo0.fsf@iki.fi> <87mtzk9n30.fsf@iki.fi> In-Reply-To: <87mtzk9n30.fsf@iki.fi> From: ian martins Date: Sat, 14 Nov 2020 10:46:10 -0500 Message-ID: Subject: Re: [PATCH] ob-java To: Jarmo Hurri Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=209.85.218.67; envelope-from=ianxm1@gmail.com; helo=mail-ej1-f67.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/14 10:46:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org-Mode mailing list Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=jhu.edu (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.91 X-TUID: ldjrYquyaGVX On Sat, Nov 14, 2020 at 6:48 AM Jarmo Hurri wrote: > Jarmo Hurri writes: > > > It seems that you have changed some classloader settings in the new > > code. I have examples which used to work perfectly; now they still > > compile, but fail to run, throwing exception > > > > java.lang.NoClassDefFoundError > > I had some extra time today, so I took a look at ob-java.el. Unless > header argument dir is set, java is run in a temporary directory. So I > can get around this problem by setting header argument > > :dir "." > > which is nice, at least as a workaround. It looks like you quoted a previous email there but I never saw it. You're right that this is a change. I will revert the default behaviour. in the meantime you could do something like (setq org-babel-default-header-args:java (cons '(:dir . ".") org-babel-default-header-args:java)) in your init file after loading org to fix it everywhere. > I am not sure what the default behaviour should be. At the moment, > though, I do not think temporary dir is a good default, because by > default the program will then the "miss" all opened (data) files as > well. Right? I agree we should not change the default behavior, but I'm not sure about data files. The run directory shouldn't change, just the place where the files are written. when I run this block the java and classfiles are written to my babel temp dir but it prints out the path of the org file. #+begin_src java :results output silent System.out.println( System.getProperty("user.dir")); #+end_src > Perhaps all babel languages have a common policy here that I am not > aware of. I've not seen it documented, but the other babel languages I've used write to the temp dir. Java is the only one I'm aware of that defaulted to writing to the current directory. > But in any case it looks to me that the behaviour has changed now, so if > it is changed in the stable branch (I am running master), I think it > should be documented clearly (as an incompatible change). Perhaps it > already is documented like that. Yes, you're right that is a change. The current behavior is documented in ob-doc-java [1], but it isn't called out as a change in behavior. This is because I didn't notice it as a change, or I'd have not done it. These changes happened in part because I wrote ob-java in a circuitous way. I first wrote ob-haxe (for the language haxe) based on ob-C and ob-python and then made ob-java from it. When I wrote ob-haxe I wasn't thinking about maintaining ob-java behaviour, and it wasn't documented, and there weren't tests, so when I had a new ob-java it wasn't easy to see what might have changed. It is very helpful that you tested your existing source blocks and investigated changes. Thanks for reporting. I'll bring back the old default behavior. [1] https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-java.html#org932f876