This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: How define single java class using kawa IO system?
- From: Per Bothner <per at bothner dot com>
- To: Yaroslav Kavenchuk <kavenchuk at gmail dot com>
- Cc: kawa at sourceware dot org
- Date: Thu, 13 Dec 2007 08:57:17 -0800
- Subject: Re: How define single java class using kawa IO system?
- References: <47614768.50707@gmail.com> <47614E39.1070606@gmail.com>
Yaroslav Kavenchuk wrote:
It is enough? (It works)
(define-simple-class test2 ()
((main (args :: <String[]>)) :: <void> allocation: 'static access:
'public
(kawa.standard.Scheme:registerEnvironment) ;; <<<<< !!!!!!!!!!
(display "Hallo, World!\n")
(force-output)))
It might work, but it is not the cleanest way to do it.
Just put the actions you in the main body of the class:
Normally, you don't write a 'main' method in Kawa - the compiler
does that for you if you specify --main. And you usually don't
define a top-level class explicitly - the "module" (source file)
does that instead.
$ cat test2.scm
(display "Hallo, World!\n")
(force-output)
$ kawa --main -C test2.scm
(compiling test2.scm to test2)
$ java -cp ~/Kawa/work3/kawa-1.9.3.jar:. test2
Hallo, World!
$
You might also consider --module-static or --module-static-run.
http://www.gnu.org/software/kawa/Application-compilation.html
http://www.gnu.org/software/kawa/Module-classes.html
http://www.gnu.org/software/kawa/Compilation-options.html
--
--Per Bothner
per@bothner.com http://per.bothner.com/