From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110830 invoked by alias); 7 Jun 2017 09:13:35 -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 110739 invoked by uid 89); 7 Jun 2017 09:13:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: Yes, score=6.3 required=5.0 tests=AWL,BAYES_05,FOREIGN_BODY1,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=world, avez, Tony, H*Ad:U*kawa X-HELO: smtps-n.oca.eu Received: from smtps-n.oca.eu (HELO smtps-n.oca.eu) (192.54.174.167) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Jun 2017 09:13:31 +0000 Received: from [192.168.109.88] (natoca100-13.unice.fr [134.59.100.13]) by smtps-n.oca.eu (Postfix) with ESMTPSA id 490708050E for ; Wed, 7 Jun 2017 11:13:33 +0200 (CEST) From: Damien MATTEI To: kawa@sourceware.org Subject: Re: Problem running Javafx hello world application Date: Wed, 07 Jun 2017 09:13:00 -0000 User-Agent: KMail/1.9.6 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201706071113.32872.Damien.Mattei@unice.fr> X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00092.txt.bz2 just for test, if you try this: (define (main) (let ((tst (invoke-static 'launch))) '()) ) does it change something? i think the probleme comes that you try to return a static object at the l= evel (toplevel or REPL) of a java function, if the main function is dynamically generated it can not return a static fi= eld, for incomatibility reason, i had such incompatibility problem in a pur= e java program. Damien Le Wednesday 07 June 2017 08:27:17 Tony West, vous avez =E9crit=A0: > Hi, >=20 > Based on what I've seen in the mailing list, I've got the following simpl= e Javafx application: >=20 > (module-name ) > (module-extends ) > (module-export start create-button) > (module-compile-options main: #t) >=20 > ;; > ;;; Application > ;; >=20 > (define (start (primary-stage :: )) :: > (invoke primary-stage 'setTitle "Hello World!") > (let ((root-pane ()) > (button (create-button > text: "Say 'Hello World'" > event-handler: (lambda (event) (format #t "Hello World!"= ))))) > (invoke (invoke root-pane 'getChildren) 'add button) > (invoke primary-stage 'setScene ( root-pane 300 2= 50)) > (invoke primary-stage 'show))) >=20 > ;; > ;;; Utilities > ;; >=20 > (define (create-button #!key (text #f) (event-handler #f)) :: =20 > (let ((button :: ())) > (when text > (invoke button 'setText text)) >=20 > (when event-handler > (invoke button 'setOnAction (object () > ((handle (event :: )) > (event-handler event))))) >=20 > button)) >=20 >=20 > ;; > ;;; Main > ;; >=20 > (define (main) > (invoke-static 'launch)) >=20 > (main) >=20 > When compiling I get the following: >=20 > E:\Work\kawa>kawa --main -C hello-world.scm > Jun 07, 2017 4:16:42 PM org.jline.utils.Log logr > WARNING: Unable to create a system terminal, creating a dumb terminal (en= able debug logging for more information) > (compiling hello-world.scm to org.kawa.javafx) >=20 > And when I run it I get the following: >=20 > E:\Work\kawa>java org.kawa.javafx > java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at com.sun.javafx.application.LauncherImpl.launchApplicationWithA= rgs(LauncherImpl.java:389) > at com.sun.javafx.application.LauncherImpl.launchApplication(Laun= cherImpl.java:328) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source) > Caused by: java.lang.IncompatibleClassChangeError: Expected static field = org.kawa.javafx$frame.$main > at org.kawa.javafx.main(hello-world.scm) > ... 11 more > Exception running application org.kawa.javafx >=20 > I would be really grateful if someone could point out what I am doing wro= ng. >=20 > Thanks. >=20 > Tony >=20 >=20