This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Help, Setting classpath, using external java libraries with Kawa
- From: Per Bothner <per at bothner dot com>
- To: Vasantha Ganesh <vasanthaganesh dot k at gmail dot com>, kawa at sourceware dot org
- Date: Sat, 1 Apr 2017 05:54:10 -0700
- Subject: Re: Help, Setting classpath, using external java libraries with Kawa
- Authentication-results: sourceware.org; auth=none
- References: <CAL0TjKoPOdeevCbyW995MdXAEw88kTinoppousMrECkAM6FvnA@mail.gmail.com>
On 04/01/2017 02:35 AM, Vasantha Ganesh wrote:
Hello Bothner,
This is probably a noob question. In Java while compiling and using
external libraries we use -classpath option. How to use external java
libraries with Kawa?
I read https://www.gnu.org/software/kawa/Compiling.html
Then I tried to compile scheme program with `--main` and `-C` options
and generated a .class file. Then I tried to run it with Java like a
normal class file by setting -classpath option, but I get:
Error: Could not find or load main class somescript
I also tried the -J option with kawa and I get
Error: Could not find or load main class
I also tried to set the CLASSPATH to the external library (jar file),
it does not work.
Show us the actual commands you're trying, including the command used
to create the jar file.
Both setting CLASSPATH and using -J should work.
Note you have to use a separate -J option for each "word":
kawa -J-cp -Jfoo.jar
is roughly equivalent to
java -cp foo.jar kawa.repl
On 04/01/2017 04:23 AM, Sudarshan S Chawathe wrote:>> From: Vasantha Ganesh <vasanthaganesh.k@gmail.com>
If I understand your question correctly then it seems you need to use
the -D option to define java.library.path suitably. Example:
kawa -Djava.library.path="/where/the/java/libs/are:/another/one:/so/on"
The java.library.path relates to native libraries (.so/.dll, not .class or .jar files).
It don't think it is relevant here.
--
--Per Bothner
per@bothner.com http://per.bothner.com/