public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Damien MATTEI <Damien.Mattei@unice.fr>
To: Per Bothner <per@bothner.com>
Cc: Kawa mailing list <kawa@sourceware.org>
Subject: Re: calling external classes method from kawa
Date: Thu, 02 Jun 2016 14:53:00 -0000	[thread overview]
Message-ID: <201606021653.09643.Damien.Mattei@unice.fr> (raw)
In-Reply-To: <e1e43c67-5bba-6a1d-aaf4-29bd674068a4@bothner.com>

Le Thursday 02 June 2016 16:34:21 Per Bothner, vous avez écrit :
> 
> On 06/02/2016 07:12 AM, Damien MATTEI wrote:
> 
> > java -jar /usr/local/share/java/kawa-2.1.jar -C ResultatGeneralFKawa.scm
> > (compiling ResultatGeneralFKawa.scm to eu.oca.kawafunct.ResultatGeneralFKawa)
> > ResultatGeneralFKawa.scm:178:5: warning - no known slot 'helloStatic' in java.lang.Object
> > ResultatGeneralFKawa.scm:178:5: warning - no declaration seen for eu.oca.DataBase
> 
> Note that documentation for the java command says:
> 
>     When you use the -jar option, the specified JAR file is the source of all
>     user classes, and other class path settings are ignored.
> 
> So you may need to use a -cp flag instead, and explicitly name kawa.repl :
> 
> java -cp /usr/local/share/java/kawa-2.1.jar:other.jar kawa.repl -C ResultatGeneralFKawa.scm
> 
> The Kawa command allows you to use a CLASSPATH enviornment variable.
> 
> The -jar option overrides the classpath.  Instead you
> 
> > the problem is that the documention say i can use -J option to pass java arguments such as defining classpath but it does not works:
> >
> > kawa -J
> > Unrecognized option: -J
> > Error: Could not create the Java Virtual Machine.
> > Error: A fatal exception has occurred. Program will exit.
> 
> Huh?  A standalone -J makes no sense, since you didn' specify any options.

i do use options but it does not works:

kawa -J-cp -J~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes -C ResultatGeneralFKawa.scm
Unrecognized option: -J-cp
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

even the help in command line does not mention the -J option:
 kawa --help
Usage: [java kawa.repl | kawa] [options ...]

 Generic options:
 --help                        Show help about options
 --author                      Show author information
 --version                     Show version information

 Options
 -e <expr>                     Evaluate expression <expr>
 -c <expr>                     Same as -e, but make sure ~/.kawarc.scm is run first
 -f <filename>                 File to interpret
 -s| --                        Start reading commands interactively from console
 -w                            Launch the interpreter in a GUI window
 --server <port>               Start a server accepting telnet connections on <port>
 --debug-dump-zip              Compiled interactive expressions to a zip archive
 --debug-print-expr            Print generated internal expressions
 --debug-print-final-expr      Print expression after any optimizations
 --debug-error-prints-stack-trace Print stack trace with errors
 --debug-warning-prints-stack-trace Print stack trace with warnings
 --[no-]full-tailcalls         (Don't) use full tail-calls
 -C <filename> ...             Compile named files to Java class files
 --output-format <format>      Use <format> when printing top-level output
 --<language>                  Select source language, one of:
   scheme .scm .sc .sld [default]
   r5rs .scm 
   r6rs .scm 
   r7rs .scm 
   krl .krl 
   brl .brl 
   emacs elisp emacs-lisp .el 
   xquery .xquery .xq .xql 
   q2 .q2 
   xslt xsl .xsl 
   commonlisp common-lisp clisp lisp .lisp .lsp .cl 
 Compilation options, must be specified before -C
 -d <dirname>                  Directory to place .class files in
 -P <prefix>                   Prefix to prepand to class names
 -T <topname>                  name to give to top-level class
 --applet                      Generate an applet
 --servlet                     Generate a servlet
 --module-static               Top-level definitions are by default static
 --full-tailcalls              support full tailcalls
 --main                        generate an application, with a main method
 --warn-as-error               Make all warnings into errors
 --warn-invoke-unknown-method  warn if invoke calls an unknown method (subsumed by warn-unknown-member)
 --warn-undefined-variable     warn if no compiler-visible binding for a variable
 --warn-unknown-member         warn if referencing an unknown method or field
 --warn-unreachable            warn if this code can never be executed
 --warn-unused                 warn if a variable is usused or code never executed
 --warn-void-used              warn if void-valued expression is used

For more information go to:  http://www.gnu.org/software/kawa/


> Instead, you can do:
> 
>    kawa -J-cp -Jmyclasses.jar
> 
> Note you have to use two -J's - one for each JVM option.
> 
> It might be easier to use a CLASSPATH environment variable.
> 



-- 
Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS

  reply	other threads:[~2016-06-02 14:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02 14:12 Damien MATTEI
2016-06-02 14:34 ` Per Bothner
2016-06-02 14:53   ` Damien MATTEI [this message]
2016-06-02 15:07   ` Damien MATTEI
2016-06-02 16:20     ` Per Bothner
2016-06-03  8:18       ` Damien MATTEI
2016-06-03  8:34         ` Damien MATTEI
2016-06-03 12:55         ` Per Bothner
2016-06-03 13:21           ` Damien MATTEI

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=201606021653.09643.Damien.Mattei@unice.fr \
    --to=damien.mattei@unice.fr \
    --cc=kawa@sourceware.org \
    --cc=per@bothner.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).