From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59331 invoked by alias); 1 Apr 2017 12:54:23 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 59317 invoked by uid 89); 1 Apr 2017 12:54:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:sk:mailfro, H*RU:sk:mailfro, H*r:sk:mailfro, H*r:10.9.9 X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Apr 2017 12:54:20 +0000 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1cuIXq-0004Ou-UX; Sat, 01 Apr 2017 14:54:19 +0200 Received: from 70-36-239-167.dsl.dynamic.fusionbroadband.com ([70.36.239.167] helo=localhost.localdomain) by mailfront11.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1cuIXk-0007TF-Fc; Sat, 01 Apr 2017 14:54:12 +0200 Subject: Re: Help, Setting classpath, using external java libraries with Kawa To: Vasantha Ganesh , kawa@sourceware.org References: From: Per Bothner Message-ID: <9c98eab6-bc5b-1254-c6e7-6aad21612576@bothner.com> Date: Sat, 01 Apr 2017 12:54:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00002.txt.bz2 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 > 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/