public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Jamison Hope <jhope@alum.mit.edu>
To: kawa mailing list <kawa@sourceware.org>
Subject: Re: simple main example hello world
Date: Sat, 30 Sep 2023 11:09:16 -0400	[thread overview]
Message-ID: <CA+ghDQ_f_AUMp4d7KzaMBHyy2vcRvUeXQEZD4d1m8WS-UEGNjQ@mail.gmail.com> (raw)
In-Reply-To: <CADEOadf0n1+8RKB3BHAMzK4+1HuEqZ4LEfQTZkYjZya1GBa3fg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1672 bytes --]

That test.main method is not static, does not have return type void, and
does not take an argument of type String[].

Try something like

((main args::String[])::void allocation: ‘static (display “hello”)
(newline))


Or just put statements at the top level and not inside a
define-simple-class, and let the module itself be the main. The simplest
hello world is a file with nothing but (display “hello”), run with kawa -f
test.scm (or maybe just kawa test.scm without the -f, I don’t have my
computer handy right now).


On Sat, Sep 30, 2023 at 10:06 AM Damien Mattei via Kawa <kawa@sourceware.org>
wrote:

> what is th problem with this:
> ;; test.scm
> (module-name demo)
> (module-compile-options main: #t)
>
> (define-simple-class test ()
>
>   ;; Need a default constructor as well.
>   ((*init*) #!void)
>
>   ((main (args :: java.lang.Object))
>     (display "hello") (newline)
>     "hello"))
>
> bash-3.2$ kawa --main -C test.scm
> (compiling test.scm to demo)
> bash-3.2$ java -cp . test
> Error: Main method not found in class test, please define the main method
> as:
>    public static void main(String[] args)
> or a JavaFX application class must extend javafx.application.Application
>
> On Sat, Sep 30, 2023 at 3:25 PM Damien Mattei <damien.mattei@gmail.com>
> wrote:
> >
> > hello,
> > many years i used kawa for web application (.war)
> > now i want to do a simple standalone program but i can not find that
> > in my archive, i knew how to do it but just forget and i can not find
> > a tutorial (needed?) on kawa site.
> >
> > how is it done? from scratch.
> > regards,
> > Damien
>

  reply	other threads:[~2023-09-30 15:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-30 13:25 Damien Mattei
2023-09-30 14:06 ` Damien Mattei
2023-09-30 15:09   ` Jamison Hope [this message]
2023-09-30 16:02     ` Per Bothner
2023-09-30 18:21       ` Damien Mattei
2023-09-30 18:35         ` Panicz Maciej Godek
2023-09-30 20:11           ` Damien Mattei
2023-09-30 23:28             ` Per Bothner
2023-10-01  8:30               ` 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=CA+ghDQ_f_AUMp4d7KzaMBHyy2vcRvUeXQEZD4d1m8WS-UEGNjQ@mail.gmail.com \
    --to=jhope@alum.mit.edu \
    --cc=kawa@sourceware.org \
    /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).