* calling external classes method from kawa
@ 2016-06-02 14:12 Damien MATTEI
2016-06-02 14:34 ` Per Bothner
0 siblings, 1 reply; 9+ messages in thread
From: Damien MATTEI @ 2016-06-02 14:12 UTC (permalink / raw)
To: Kawa mailing list
Hi,
all is in the title, i want to call external classes method from kawa,
i have a kawa class from which i want to call a method of a java class compiled not in kawa but javac, i tried many way but the class and method is unknow at runtime and i got wrning at compilation:
the kawa class is ResultatGeneralFKawa.scm
with this inside:
(module-name "eu.oca.kawafunct.ResultatGeneralFKawa")
(require 'regex)
(define-simple-class ResultatGeneralFKawa ()
[code cut]
((work) ::int
(eu.oca.DataBase:helloStatic)
0)
the java DataBase class has some method such as:
public class DataBase {
[code cut]
public static void helloStatic() {
System.out.println("Sidonie : DataBase : helloStatic : Hello !");
}
when compiling i have of course wrnings:
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
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.
i tried to copy DataBase.class definition in same place as ResultatGeneralFKawa.scm or in eu/oca where is the module (originally the module is in NetBeansProjects/Sidonie/build/web/WEB-INF/classes/eu/oca/DataBase.class
but nothing worked....
just want to call method of an external classes in kawa? is it possible?
already read the doc: http://www.gnu.org/software/kawa/Method-operations.html
find no suitable solution...
errors is now at runtime:
Etat HTTP 500 - ResultatGeneralFKawa.scm:178:5: unbound location: eu.oca.DataBase
type Rapport d''exception
message ResultatGeneralFKawa.scm:178:5: unbound location: eu.oca.DataBase
description Le serveur a rencontré une erreur interne qui l''a empêché de satisfaire la requête.
exception
javax.servlet.ServletException: ResultatGeneralFKawa.scm:178:5: unbound location: eu.oca.DataBase
org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:392)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:382)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:345)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:220)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
cause mère
ResultatGeneralFKawa.scm:178:5: unbound location: eu.oca.DataBase
gnu.mapping.SharedLocation.get(SharedLocation.java:22)
gnu.mapping.DynamicLocation.get(DynamicLocation.java:28)
eu.oca.kawafunct.ResultatGeneralFKawa.work(ResultatGeneralFKawa.scm:178)
eu.oca.kawafunct.ResultatGeneralFKawa.<init>(ResultatGeneralFKawa.scm:120)
eu.oca.ResultatGeneralF.postHandler(ResultatGeneralF.java:107)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:497)
org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:195)
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:402)
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:349)
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:106)
org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:259)
org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
org.glassfish.jersey.internal.Errors.process(Errors.java:315)
org.glassfish.jersey.internal.Errors.process(Errors.java:297)
org.glassfish.jersey.internal.Errors.process(Errors.java:267)
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:318)
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:236)
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1010)
org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:373)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:382)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:345)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:220)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note La trace complète de la cause mère de cette erreur est disponible dans les fichiers journaux de Apache Tomcat/8.0.27.
Apache Tomcat/8.0.27
Regards,
Damien
--
Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: calling external classes method from kawa
2016-06-02 14:12 calling external classes method from kawa Damien MATTEI
@ 2016-06-02 14:34 ` Per Bothner
2016-06-02 14:53 ` Damien MATTEI
2016-06-02 15:07 ` Damien MATTEI
0 siblings, 2 replies; 9+ messages in thread
From: Per Bothner @ 2016-06-02 14:34 UTC (permalink / raw)
To: Damien MATTEI, Kawa mailing list
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.
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.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: calling external classes method from kawa
2016-06-02 14:34 ` Per Bothner
@ 2016-06-02 14:53 ` Damien MATTEI
2016-06-02 15:07 ` Damien MATTEI
1 sibling, 0 replies; 9+ messages in thread
From: Damien MATTEI @ 2016-06-02 14:53 UTC (permalink / raw)
To: Per Bothner; +Cc: Kawa mailing list
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: calling external classes method from kawa
2016-06-02 14:34 ` Per Bothner
2016-06-02 14:53 ` Damien MATTEI
@ 2016-06-02 15:07 ` Damien MATTEI
2016-06-02 16:20 ` Per Bothner
1 sibling, 1 reply; 9+ messages in thread
From: Damien MATTEI @ 2016-06-02 15:07 UTC (permalink / raw)
To: Per Bothner; +Cc: Kawa mailing list
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.
> 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.
>
i tried a lot of things but still get the warnings:
[mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:other.jar kawa.repl -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
[mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl -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
[mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes/eu/oca kawa.repl -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
[mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes/eu/oca/DataBase.class kawa.repl -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
[mattei@moita Jkawa]$ locate Sidonie.war
/home/mattei/Sidonie.war
/home/mattei/NetBeansProjects/Sidonie/dist/Sidonie.war
/usr/local/apache-tomcat-8.0.27/webapps/Sidonie.war
[mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:/home/mattei/NetBeansProjects/Sidonie/dist/Sidonie.war kawa.repl -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
[mattei@moita Jkawa]$ cd ~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes/
[mattei@moita classes]$ zd
total 0
drwxrwxr-x. 3 mattei mattei 15 2 juin 15:50 .
drwxrwxr-x. 4 mattei mattei 30 2 juin 15:50 ..
drwxrwxr-x. 3 mattei mattei 16 2 juin 15:50 eu
[mattei@moita classes]$ jar cf ~/Dropbox/Sidonie.jar eu[mattei@moita classes]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/Dropbox/Sidonie.jar kawa.repl -C ResultatGeneralFKawa.scm
java.io.FileNotFoundException: /home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes/ResultatGeneralFKawa.scm (Aucun fichier ou dossier de ce type)
[mattei@moita classes]$ cd -
/home/mattei/Dropbox/Jkawa
[mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/Dropbox/Sidonie.jar kawa.repl -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
any idea?
if i can not do it in kawa, i will make it with bigloo as i have not this problem with it ,but i will keep trying again later...
regards,
damien
--
Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: calling external classes method from kawa
2016-06-02 15:07 ` Damien MATTEI
@ 2016-06-02 16:20 ` Per Bothner
2016-06-03 8:18 ` Damien MATTEI
0 siblings, 1 reply; 9+ messages in thread
From: Per Bothner @ 2016-06-02 16:20 UTC (permalink / raw)
To: Damien MATTEI; +Cc: Kawa mailing list
On 06/02/2016 08:06 AM, Damien MATTEI wrote:
> [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl -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
> [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes/eu/oca kawa.repl -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
> [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes/eu/oca/DataBase.class kawa.repl -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
I don't believe '~' would work for the home directory.
It is normally expanded by the shell - but only when it's the first character in a "word".
> [mattei@moita Jkawa]$ locate Sidonie.war
> /home/mattei/Sidonie.war
> /home/mattei/NetBeansProjects/Sidonie/dist/Sidonie.war
> /usr/local/apache-tomcat-8.0.27/webapps/Sidonie.war
> [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:/home/mattei/NetBeansProjects/Sidonie/dist/Sidonie.war kawa.repl -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
I don't believe a 'war' file can be used as if it were a 'jar' file.
It has a special layout, where classes are in WEB-INF/classes, which the JVM doesn't know about.
For that to work, you have to get a non-empty result from
jar tvf /home/mattei/NetBeansProjects/Sidonie/dist/Sidonie.war eu/oca/DataBase/helloStatic.class
> any idea?
Don't use '~' in paths.
> if i can not do it in kawa, i will make it with bigloo as i have not this problem with it ,but i will keep trying again later...
It's almost certainly not a Kawa bug.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: calling external classes method from kawa
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
0 siblings, 2 replies; 9+ messages in thread
From: Damien MATTEI @ 2016-06-03 8:18 UTC (permalink / raw)
To: Per Bothner; +Cc: Kawa mailing list
thanks you,
finally we got it:
[mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:/home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl -C ResultatGeneralFKawa.scm
(compiling ResultatGeneralFKawa.scm to eu.oca.kawafunct.ResultatGeneralFKawa)
no more warnings at compilation (will check the runtime later)
for info -J option seems unrecognized on my kawa version (compiled from sources) but that's not a problem as it compiles the other way:
[mattei@moita Jkawa]$ kawa -J-cp -J/home/mattei/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.
Damien
Le Thursday 02 June 2016 18:20:26 Per Bothner, vous avez écrit :
>
> On 06/02/2016 08:06 AM, Damien MATTEI wrote:
>
> > [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl -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
> > [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes/eu/oca kawa.repl -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
> > [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes/eu/oca/DataBase.class kawa.repl -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
>
> I don't believe '~' would work for the home directory.
> It is normally expanded by the shell - but only when it's the first character in a "word".
>
> > [mattei@moita Jkawa]$ locate Sidonie.war
> > /home/mattei/Sidonie.war
> > /home/mattei/NetBeansProjects/Sidonie/dist/Sidonie.war
> > /usr/local/apache-tomcat-8.0.27/webapps/Sidonie.war
> > [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:/home/mattei/NetBeansProjects/Sidonie/dist/Sidonie.war kawa.repl -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
>
> I don't believe a 'war' file can be used as if it were a 'jar' file.
> It has a special layout, where classes are in WEB-INF/classes, which the JVM doesn't know about.
> For that to work, you have to get a non-empty result from
>
> jar tvf /home/mattei/NetBeansProjects/Sidonie/dist/Sidonie.war eu/oca/DataBase/helloStatic.class
>
> > any idea?
>
> Don't use '~' in paths.
>
> > if i can not do it in kawa, i will make it with bigloo as i have not this problem with it ,but i will keep trying again later...
>
> It's almost certainly not a Kawa bug.
>
--
Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: calling external classes method from kawa
2016-06-03 8:18 ` Damien MATTEI
@ 2016-06-03 8:34 ` Damien MATTEI
2016-06-03 12:55 ` Per Bothner
1 sibling, 0 replies; 9+ messages in thread
From: Damien MATTEI @ 2016-06-03 8:34 UTC (permalink / raw)
To: kawa; +Cc: Per Bothner
Great !!! it works at runtime too:
Sidonie : DataBase : helloStatic : Hello !
i can start doing serious things in kawa now, not only with bigloo....
i needed to access java ODBC written routines already uses with bigloo scheme
now i will be able to reuse them in kawa too...
regards,
damien
Le Friday 03 June 2016 10:18:33 Damien MATTEI, vous avez écrit :
> thanks you,
>
> finally we got it:
> [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:/home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl -C ResultatGeneralFKawa.scm
> (compiling ResultatGeneralFKawa.scm to eu.oca.kawafunct.ResultatGeneralFKawa)
>
> no more warnings at compilation (will check the runtime later)
>
> for info -J option seems unrecognized on my kawa version (compiled from sources) but that's not a problem as it compiles the other way:
>
> [mattei@moita Jkawa]$ kawa -J-cp -J/home/mattei/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.
>
> Damien
>
> Le Thursday 02 June 2016 18:20:26 Per Bothner, vous avez écrit :
> >
> > On 06/02/2016 08:06 AM, Damien MATTEI wrote:
> >
> > > [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl -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
> > > [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes/eu/oca kawa.repl -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
> > > [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:~/NetBeansProjects/Sidonie/build/web/WEB-INF/classes/eu/oca/DataBase.class kawa.repl -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
> >
> > I don't believe '~' would work for the home directory.
> > It is normally expanded by the shell - but only when it's the first character in a "word".
> >
> > > [mattei@moita Jkawa]$ locate Sidonie.war
> > > /home/mattei/Sidonie.war
> > > /home/mattei/NetBeansProjects/Sidonie/dist/Sidonie.war
> > > /usr/local/apache-tomcat-8.0.27/webapps/Sidonie.war
> > > [mattei@moita Jkawa]$ java -cp /usr/local/share/java/kawa-2.1.jar:/home/mattei/NetBeansProjects/Sidonie/dist/Sidonie.war kawa.repl -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
> >
> > I don't believe a 'war' file can be used as if it were a 'jar' file.
> > It has a special layout, where classes are in WEB-INF/classes, which the JVM doesn't know about.
> > For that to work, you have to get a non-empty result from
> >
> > jar tvf /home/mattei/NetBeansProjects/Sidonie/dist/Sidonie.war eu/oca/DataBase/helloStatic.class
> >
> > > any idea?
> >
> > Don't use '~' in paths.
> >
> > > if i can not do it in kawa, i will make it with bigloo as i have not this problem with it ,but i will keep trying again later...
> >
> > It's almost certainly not a Kawa bug.
> >
>
>
>
--
Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: calling external classes method from kawa
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
1 sibling, 1 reply; 9+ messages in thread
From: Per Bothner @ 2016-06-03 12:55 UTC (permalink / raw)
To: Damien MATTEI; +Cc: Kawa mailing list
On 06/03/2016 01:18 AM, Damien MATTEI wrote:
> for info -J option seems unrecognized on my kawa version (compiled from sources) but that's not a problem as it compiles the other way:
That was a bug in the bin/kawa.sh.in shell script template.
I checked in a fix for this. Please try it.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: calling external classes method from kawa
2016-06-03 12:55 ` Per Bothner
@ 2016-06-03 13:21 ` Damien MATTEI
0 siblings, 0 replies; 9+ messages in thread
From: Damien MATTEI @ 2016-06-03 13:21 UTC (permalink / raw)
To: Per Bothner; +Cc: Kawa mailing list
Le Friday 03 June 2016 14:54:28 Per Bothner, vous avez écrit :
>
> On 06/03/2016 01:18 AM, Damien MATTEI wrote:
> > for info -J option seems unrecognized on my kawa version (compiled from sources) but that's not a problem as it compiles the other way:
>
> That was a bug in the bin/kawa.sh.in shell script template.
> I checked in a fix for this. Please try it.
i will test it as soon as possible or the next time i install kawa from source on a computer or if i upgrade to a new version.
regards,
Damien
--
Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-06-03 13:21 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-02 14:12 calling external classes method from kawa Damien MATTEI
2016-06-02 14:34 ` Per Bothner
2016-06-02 14:53 ` Damien MATTEI
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
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).