From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111500 invoked by alias); 1 Apr 2017 13:11:31 -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 111481 invoked by uid 89); 1 Apr 2017 13:11:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-ua0-f182.google.com Received: from mail-ua0-f182.google.com (HELO mail-ua0-f182.google.com) (209.85.217.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Apr 2017 13:11:28 +0000 Received: by mail-ua0-f182.google.com with SMTP id 17so8256213uah.0 for ; Sat, 01 Apr 2017 06:11: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=W3amt5E5b/+bwg3EFkqZafeNnbwZW9Bwo8I48vRXKVo=; b=l8aatRZDMp2rAiOxr0RZmv1iOhPlsuOveC6zPcZbzH3hHI0SHmt8wZR49IMX6hrL1s wc7zyueePihABAHI7Xbiv8INJt8sOJNwnT1j6EP+oh0xw23CG7OCyE64p+gsxgDDdUmv 1TI7jOOum02xDtIZHG9C4gk+cmc5//c2ju0oSGa1TP5u1L7CyR7af6vjNsNRoi717LO1 3HsPdPwjZ4O5KITb5Rx5ra4BylfjKcIc13KE/1rNb6B9q1Gm7DNAV2Mz3uL0vitseHMc wsfseJIfDuTYDI+hKdWbCepun/zSOrx7KIfEGSZdQX9fD9EJn32kAj6kUgMNKGtCsXLP 4nRw== X-Gm-Message-State: AFeK/H3bPuosba7tpQkHqbNZwaOGiO9qiMw/deJ5Pc2ShAo3hm0srBVuNY2VetFaTX19WbwWIRBGgqr+dQW2gQ== X-Received: by 10.159.54.162 with SMTP id p31mr4247729uap.67.1491052288327; Sat, 01 Apr 2017 06:11:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.81.136 with HTTP; Sat, 1 Apr 2017 06:11:27 -0700 (PDT) In-Reply-To: <9c98eab6-bc5b-1254-c6e7-6aad21612576@bothner.com> References: <9c98eab6-bc5b-1254-c6e7-6aad21612576@bothner.com> From: Vasantha Ganesh Date: Sat, 01 Apr 2017 13:11: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/msg00003.txt.bz2 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/