From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115993 invoked by alias); 1 Apr 2017 13:16:30 -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 115982 invoked by uid 89); 1 Apr 2017 13:16:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2677 X-HELO: mail-ua0-f173.google.com Received: from mail-ua0-f173.google.com (HELO mail-ua0-f173.google.com) (209.85.217.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Apr 2017 13:16:28 +0000 Received: by mail-ua0-f173.google.com with SMTP id d64so8306073uad.2 for ; Sat, 01 Apr 2017 06:16:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Il6F8S/UU6SVU+XSn261vReuAwLEpoJCpr2+auoFmso=; b=LzdtT1u+jc0wTxss0u0p/DiTjQF4j/EXQZ5wxaXYoG6lSjLHzZ6ZKdQHRjHDakHH+H UFjeTG1kAcgEoQanj/Ff5IALtVo6PD8nY+e0tsJql+Z9skgPqxg+28m5RmeWrUQd8FwP 5f/dGYmj9VDkmuZV+bMw/NlUZwa0UyTgNVUruPpFOHTchct3QIIc5/Kez3Tcn8SrJMDm hK9bqjlMGBMTkcUkSnKq7j5l0xtC7eis31A0Cb7wPGdl96LO4Db8Ssb/TY46iqBwPDNE uma4W5E8Dc+aA470TCQFUeY70RQhYcLWOHU5EZ0xELVq162JCU0X3sxeA4fbYwAoq78K L1ww== X-Gm-Message-State: AFeK/H1hHZEgyV6T/9euoboeyjFzQMI+1/gln3u5hTLBiW4RK5pJmTNV7T7iWEs3FGU3quJ4fk6OuvWfUZai3A== X-Received: by 10.176.67.164 with SMTP id l33mr3201471ual.53.1491052587557; Sat, 01 Apr 2017 06:16:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.81.136 with HTTP; Sat, 1 Apr 2017 06:16:27 -0700 (PDT) In-Reply-To: References: <9c98eab6-bc5b-1254-c6e7-6aad21612576@bothner.com> From: Vasantha Ganesh Date: Sat, 01 Apr 2017 13:16:00 -0000 Message-ID: Subject: Re: Help, Setting classpath, using external java libraries with Kawa To: Per Bothner Cc: kawa@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00004.txt.bz2 for java it was actually: java -cp /usr/share/java/jnr-ffi.jar:.:/usr/lib/java/jffi.jar:/usr/lib/java/jffi-native.jar:/usr/share/java/objectweb-asm/asm.jar Getpid Vasantha Ganesh K. On Sat, Apr 1, 2017 at 6:41 PM, Vasantha Ganesh wrote: > Hello, > I'm trying to convert this(http://lpaste.net/354170) Java code into > Scheme(Kawa) (http://lpaste.net/354171). > > I ran this for java and it ran without hickups, > > java -cp /usr/share/java/jnr-ffi.jar:.:/usr/lib/java/jffi.jar:/usr/lib/java/jffi-native.jar:/usr/share/java/objectweb-asm/asm.jar > Getpid.java > > and for kawa, I ran this: > > kawa -J -cp /usr/share/java/jnr-ffi.jar:.:/usr/lib/java/jffi.jar:/usr/lib/java/jffi-native.jar:/usr/share/java/objectweb-asm/asm.jar > getpid.scm > > The exact error that I get is: > > Error: Could not find or load main class > > Thank you, > > Vasantha Ganesh K. > > On Sat, Apr 1, 2017 at 6:24 PM, Per Bothner wrote: >> 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/