public inbox for
 help / color / mirror / Atom feed
From: Peter Lane <>
Subject: import path vs CLASSPATH
Date: Wed, 08 Feb 2017 18:37:00 -0000	[thread overview]
Message-ID: <> (raw)

(This is not really a question, but more an observation - perhaps a 
curious query.)

I found there's a difference between import path and CLASSPATH, with 
respect to how kawa locates libraries: "import path" seems to be 
relative to the input program, whereas CLASSPATH is relative to the caller.

The Kawa documentation says "The default search path is |"."| - i.e. 
just search relative to the current root"; I was expecting the current 
root to be the directory where I ran kawa, but it appears to be the 
location of the program.

e.g. if I use -Dkawa.import.path="./*.sld", library files are found only 
in the same directory as the program I run:

 > kawa --r7rs -Dkawa.import.path="./*.sld"  dir/program.sps

only finds libraries within dir, and fails if the required library is in 
the current (caller's) directory.  (If the libraries are in 'dir' the 
import is unnecessary: kawa --r7rs dir/program.sps will find 

However, if I compile the library: > kawa -C mylibrary.sld, and set 

then the .class file for the library will be found relative to the 
caller's directory.

I came across this because I'm working with a Java library and writing 
lots of scripts for different tasks.  Some common functions are bundled 
up in a library, for them all to use.  The library sits in the directory 
I run kawa from, and child directories hold the scripts.  I've set my 
run script to use the import path:
-Dkawa.import.path="$(cd "$(dirname "$0")" ; pwd)/*.sld"
which finds the script's path and sets up an absolute path to the import 

Now I'm aware of this, it's not a problem, but it did confuse me for a bit.

Peter Lane

             reply	other threads:[~2017-02-08 18:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 18:37 Peter Lane [this message]
2017-02-08 21:42 ` Per Bothner
2017-02-13 19:31   ` Peter Lane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).