public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* How to access JavaFx class library from Kawa?
@ 2018-10-28 12:56 Arie van Wingerden
  2018-10-28 13:43 ` Sudarshan S Chawathe
  0 siblings, 1 reply; 7+ messages in thread
From: Arie van Wingerden @ 2018-10-28 12:56 UTC (permalink / raw)
  To: kawa

Hi,

when trying to run your JavaFx example from here:
https://per.bothner.com/blog/2011/JavaFX-using-Kawa-intro/ I get errors
like: Exception in thread "main" java.lang.NoClassDefFoundError:
javafx/geometry/Orientation.

This is understandable, since I only unpacked JavaFx in a folder, but I
don't know how to inform Kawa how to find JavaFx stuff.

As you may guess I am not at all acquainted with Java :)

I am on Windows 10 and have OpenJdk 11.08 and JavaFx 11.
Also, I added the bin dir of openjdk to my system path.

So, please tell me how to enable using JavaFx as well ...

Many thanks!

/Arie

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to access JavaFx class library from Kawa?
  2018-10-28 12:56 How to access JavaFx class library from Kawa? Arie van Wingerden
@ 2018-10-28 13:43 ` Sudarshan S Chawathe
  2018-10-28 14:21   ` Arie van Wingerden
  0 siblings, 1 reply; 7+ messages in thread
From: Sudarshan S Chawathe @ 2018-10-28 13:43 UTC (permalink / raw)
  To: Arie van Wingerden; +Cc: kawa

> when trying to run your JavaFx example from here:
> https://per.bothner.com/blog/2011/JavaFX-using-Kawa-intro/ I get errors
> like: Exception in thread "main" java.lang.NoClassDefFoundError:
> javafx/geometry/Orientation.
> 
> This is understandable, since I only unpacked JavaFx in a folder, but I
> don't know how to inform Kawa how to find JavaFx stuff.

If you set CLASSPATH for Java one way or the other (environment
variable, command-line option, ...) to include the JavaFX .jar files
then you should be able to use JavaFX from Kawa as well.  At least, that
has been my experiance on a standard Debian-based setup.

The CLASSPATH syntax allows using "*" to indicate "all jars in
directory" which I find useful in such cases to avoid having to
enumerate jars individually.

Regards,

-chaw

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to access JavaFx class library from Kawa?
  2018-10-28 13:43 ` Sudarshan S Chawathe
@ 2018-10-28 14:21   ` Arie van Wingerden
  2018-10-28 15:18     ` Sudarshan S Chawathe
  2018-10-28 15:19     ` Arie van Wingerden
  0 siblings, 2 replies; 7+ messages in thread
From: Arie van Wingerden @ 2018-10-28 14:21 UTC (permalink / raw)
  To: chaw; +Cc: kawa

Hi Chaw,

thx!

Now tried this:
   set CLASSPATH=E:\Programs\openjdk\lib\*;E:\Programs\openjfx\lib\*;.\*
last one is for jars in current dir.

But it still fails because it cannot find javafx/geometry/Orientation.

In openjfx\lib I see:
javafx-swt.jar
javafx.base.jar
javafx.controls.jar
javafx.fxml.jar
javafx.graphics.jar
javafx.media.jar
javafx.properties
javafx.swing.jar
javafx.web.jar
src.zip

But no "geometry" or similar.

/Arie

Op zo 28 okt. 2018 om 14:43 schreef Sudarshan S Chawathe <chaw@eip10.org>:

> > when trying to run your JavaFx example from here:
> > https://per.bothner.com/blog/2011/JavaFX-using-Kawa-intro/ I get errors
> > like: Exception in thread "main" java.lang.NoClassDefFoundError:
> > javafx/geometry/Orientation.
> >
> > This is understandable, since I only unpacked JavaFx in a folder, but I
> > don't know how to inform Kawa how to find JavaFx stuff.
>
> If you set CLASSPATH for Java one way or the other (environment
> variable, command-line option, ...) to include the JavaFX .jar files
> then you should be able to use JavaFX from Kawa as well.  At least, that
> has been my experiance on a standard Debian-based setup.
>
> The CLASSPATH syntax allows using "*" to indicate "all jars in
> directory" which I find useful in such cases to avoid having to
> enumerate jars individually.
>
> Regards,
>
> -chaw
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to access JavaFx class library from Kawa?
  2018-10-28 14:21   ` Arie van Wingerden
@ 2018-10-28 15:18     ` Sudarshan S Chawathe
  2018-10-28 15:19     ` Arie van Wingerden
  1 sibling, 0 replies; 7+ messages in thread
From: Sudarshan S Chawathe @ 2018-10-28 15:18 UTC (permalink / raw)
  To: Arie van Wingerden; +Cc: kawa

> Now tried this:
>    set CLASSPATH=E:\Programs\openjdk\lib\*;E:\Programs\openjfx\lib\*;.\*
> last one is for jars in current dir.
> 
> But it still fails because it cannot find javafx/geometry/Orientation.
> 
> In openjfx\lib I see:
> javafx-swt.jar
> javafx.base.jar
> javafx.controls.jar
> javafx.fxml.jar
> javafx.graphics.jar
> javafx.media.jar
> javafx.properties
> javafx.swing.jar
> javafx.web.jar
> src.zip
> 
> But no "geometry" or similar.
>
> /Arie

The CLASSPATH should include jfxrt.jar, which has the geometry package.
In my setup, that file's location is (not the "ext" subdirectory): 

  /usr/share/java/openjfx/jre/lib/ext/jfxrt.jar

Regards,

-chaw


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to access JavaFx class library from Kawa?
  2018-10-28 14:21   ` Arie van Wingerden
  2018-10-28 15:18     ` Sudarshan S Chawathe
@ 2018-10-28 15:19     ` Arie van Wingerden
  2018-10-28 15:22       ` Arie van Wingerden
  1 sibling, 1 reply; 7+ messages in thread
From: Arie van Wingerden @ 2018-10-28 15:19 UTC (permalink / raw)
  To: chaw; +Cc: kawa

With a bit of trial and error I got it to work.

Now, when I start a command prompt for Kawa, I initially set an environment
variable:
set KAWA_USERPATH =
E:\Programs\openjfx\lib\javafx.base.jar;E:\Programs\openjfx\lib\javafx.controls.jar;E:\Programs\openjfx\lib\javafx.fxml.jar;E:\Programs\openjfx\lib\javafx.graphics.jar;E:\Programs\openjfx\lib\javafx.media.jar;E:\Programs\openjfx\lib\javafx.swing.jar;E:\Programs\openjfx\lib\javafx.web.jar;E:\Programs\openjfx\lib\javafx-swt.jar

Also I slightly modified kawa.bat and add my path to KAWA-EXTRA-PATH:
   set KAWA_EXTRA_PATH =
"%KAWA_HOME%\lib\jline.jar;%KAWA_HOME%\lib\domterm.jar;%KAWA_HOME%\lib\servlet.jar;"%KAWA_USERPATH%

In this way it works!

Please tell me if there is a more elegant way to do this ...

Thx!

/Arie


Op zo 28 okt. 2018 om 15:21 schreef Arie van Wingerden <xapwing@gmail.com>:

> Hi Chaw,
>
> thx!
>
> Now tried this:
>    set CLASSPATH=E:\Programs\openjdk\lib\*;E:\Programs\openjfx\lib\*;.\*
> last one is for jars in current dir.
>
> But it still fails because it cannot find javafx/geometry/Orientation.
>
> In openjfx\lib I see:
> javafx-swt.jar
> javafx.base.jar
> javafx.controls.jar
> javafx.fxml.jar
> javafx.graphics.jar
> javafx.media.jar
> javafx.properties
> javafx.swing.jar
> javafx.web.jar
> src.zip
>
> But no "geometry" or similar.
>
> /Arie
>
> Op zo 28 okt. 2018 om 14:43 schreef Sudarshan S Chawathe <chaw@eip10.org>:
>
>> > when trying to run your JavaFx example from here:
>> > https://per.bothner.com/blog/2011/JavaFX-using-Kawa-intro/ I get errors
>> > like: Exception in thread "main" java.lang.NoClassDefFoundError:
>> > javafx/geometry/Orientation.
>> >
>> > This is understandable, since I only unpacked JavaFx in a folder, but I
>> > don't know how to inform Kawa how to find JavaFx stuff.
>>
>> If you set CLASSPATH for Java one way or the other (environment
>> variable, command-line option, ...) to include the JavaFX .jar files
>> then you should be able to use JavaFX from Kawa as well.  At least, that
>> has been my experiance on a standard Debian-based setup.
>>
>> The CLASSPATH syntax allows using "*" to indicate "all jars in
>> directory" which I find useful in such cases to avoid having to
>> enumerate jars individually.
>>
>> Regards,
>>
>> -chaw
>>
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to access JavaFx class library from Kawa?
  2018-10-28 15:19     ` Arie van Wingerden
@ 2018-10-28 15:22       ` Arie van Wingerden
  2018-10-29  7:22         ` Arie van Wingerden
  0 siblings, 1 reply; 7+ messages in thread
From: Arie van Wingerden @ 2018-10-28 15:22 UTC (permalink / raw)
  To: chaw; +Cc: kawa

Hi Chaw,

that's weird, since I got it to work without having that :)
See my previous post listing all jars I needed obviously.

Thx!

Op zo 28 okt. 2018 om 16:19 schreef Arie van Wingerden <xapwing@gmail.com>:

> With a bit of trial and error I got it to work.
>
> Now, when I start a command prompt for Kawa, I initially set an
> environment variable:
> set KAWA_USERPATH =
> E:\Programs\openjfx\lib\javafx.base.jar;E:\Programs\openjfx\lib\javafx.controls.jar;E:\Programs\openjfx\lib\javafx.fxml.jar;E:\Programs\openjfx\lib\javafx.graphics.jar;E:\Programs\openjfx\lib\javafx.media.jar;E:\Programs\openjfx\lib\javafx.swing.jar;E:\Programs\openjfx\lib\javafx.web.jar;E:\Programs\openjfx\lib\javafx-swt.jar
>
> Also I slightly modified kawa.bat and add my path to KAWA-EXTRA-PATH:
>    set KAWA_EXTRA_PATH =
> "%KAWA_HOME%\lib\jline.jar;%KAWA_HOME%\lib\domterm.jar;%KAWA_HOME%\lib\servlet.jar;"%KAWA_USERPATH%
>
> In this way it works!
>
> Please tell me if there is a more elegant way to do this ...
>
> Thx!
>
> /Arie
>
>
> Op zo 28 okt. 2018 om 15:21 schreef Arie van Wingerden <xapwing@gmail.com
> >:
>
>> Hi Chaw,
>>
>> thx!
>>
>> Now tried this:
>>    set CLASSPATH=E:\Programs\openjdk\lib\*;E:\Programs\openjfx\lib\*;.\*
>> last one is for jars in current dir.
>>
>> But it still fails because it cannot find javafx/geometry/Orientation.
>>
>> In openjfx\lib I see:
>> javafx-swt.jar
>> javafx.base.jar
>> javafx.controls.jar
>> javafx.fxml.jar
>> javafx.graphics.jar
>> javafx.media.jar
>> javafx.properties
>> javafx.swing.jar
>> javafx.web.jar
>> src.zip
>>
>> But no "geometry" or similar.
>>
>> /Arie
>>
>> Op zo 28 okt. 2018 om 14:43 schreef Sudarshan S Chawathe <chaw@eip10.org
>> >:
>>
>>> > when trying to run your JavaFx example from here:
>>> > https://per.bothner.com/blog/2011/JavaFX-using-Kawa-intro/ I get
>>> errors
>>> > like: Exception in thread "main" java.lang.NoClassDefFoundError:
>>> > javafx/geometry/Orientation.
>>> >
>>> > This is understandable, since I only unpacked JavaFx in a folder, but I
>>> > don't know how to inform Kawa how to find JavaFx stuff.
>>>
>>> If you set CLASSPATH for Java one way or the other (environment
>>> variable, command-line option, ...) to include the JavaFX .jar files
>>> then you should be able to use JavaFX from Kawa as well.  At least, that
>>> has been my experiance on a standard Debian-based setup.
>>>
>>> The CLASSPATH syntax allows using "*" to indicate "all jars in
>>> directory" which I find useful in such cases to avoid having to
>>> enumerate jars individually.
>>>
>>> Regards,
>>>
>>> -chaw
>>>
>>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to access JavaFx class library from Kawa?
  2018-10-28 15:22       ` Arie van Wingerden
@ 2018-10-29  7:22         ` Arie van Wingerden
  0 siblings, 0 replies; 7+ messages in thread
From: Arie van Wingerden @ 2018-10-29  7:22 UTC (permalink / raw)
  To: chaw; +Cc: kawa

During my search for a solution, I found out that kawa.bat uses an
unnecessary construction:
   set
KAWA_EXTRA_PATH="%KAWA_HOME%\lib\jline.jar;%KAWA_HOME%\lib\domterm.jar;%KAWA_HOME%\lib\servlet.jar"

This can be much shorter and easier and less error prone using the asterisk:
   set KAWA_EXTRA_PATH=%KAWA_HOME%\lib\*


Op zo 28 okt. 2018 om 16:21 schreef Arie van Wingerden <xapwing@gmail.com>:

> Hi Chaw,
>
> that's weird, since I got it to work without having that :)
> See my previous post listing all jars I needed obviously.
>
> Thx!
>
> Op zo 28 okt. 2018 om 16:19 schreef Arie van Wingerden <xapwing@gmail.com
> >:
>
>> With a bit of trial and error I got it to work.
>>
>> Now, when I start a command prompt for Kawa, I initially set an
>> environment variable:
>> set KAWA_USERPATH =
>> E:\Programs\openjfx\lib\javafx.base.jar;E:\Programs\openjfx\lib\javafx.controls.jar;E:\Programs\openjfx\lib\javafx.fxml.jar;E:\Programs\openjfx\lib\javafx.graphics.jar;E:\Programs\openjfx\lib\javafx.media.jar;E:\Programs\openjfx\lib\javafx.swing.jar;E:\Programs\openjfx\lib\javafx.web.jar;E:\Programs\openjfx\lib\javafx-swt.jar
>>
>> Also I slightly modified kawa.bat and add my path to KAWA-EXTRA-PATH:
>>    set KAWA_EXTRA_PATH =
>> "%KAWA_HOME%\lib\jline.jar;%KAWA_HOME%\lib\domterm.jar;%KAWA_HOME%\lib\servlet.jar;"%KAWA_USERPATH%
>>
>> In this way it works!
>>
>> Please tell me if there is a more elegant way to do this ...
>>
>> Thx!
>>
>> /Arie
>>
>>
>> Op zo 28 okt. 2018 om 15:21 schreef Arie van Wingerden <xapwing@gmail.com
>> >:
>>
>>> Hi Chaw,
>>>
>>> thx!
>>>
>>> Now tried this:
>>>    set CLASSPATH=E:\Programs\openjdk\lib\*;E:\Programs\openjfx\lib\*;.\*
>>> last one is for jars in current dir.
>>>
>>> But it still fails because it cannot find javafx/geometry/Orientation.
>>>
>>> In openjfx\lib I see:
>>> javafx-swt.jar
>>> javafx.base.jar
>>> javafx.controls.jar
>>> javafx.fxml.jar
>>> javafx.graphics.jar
>>> javafx.media.jar
>>> javafx.properties
>>> javafx.swing.jar
>>> javafx.web.jar
>>> src.zip
>>>
>>> But no "geometry" or similar.
>>>
>>> /Arie
>>>
>>> Op zo 28 okt. 2018 om 14:43 schreef Sudarshan S Chawathe <chaw@eip10.org
>>> >:
>>>
>>>> > when trying to run your JavaFx example from here:
>>>> > https://per.bothner.com/blog/2011/JavaFX-using-Kawa-intro/ I get
>>>> errors
>>>> > like: Exception in thread "main" java.lang.NoClassDefFoundError:
>>>> > javafx/geometry/Orientation.
>>>> >
>>>> > This is understandable, since I only unpacked JavaFx in a folder, but
>>>> I
>>>> > don't know how to inform Kawa how to find JavaFx stuff.
>>>>
>>>> If you set CLASSPATH for Java one way or the other (environment
>>>> variable, command-line option, ...) to include the JavaFX .jar files
>>>> then you should be able to use JavaFX from Kawa as well.  At least, that
>>>> has been my experiance on a standard Debian-based setup.
>>>>
>>>> The CLASSPATH syntax allows using "*" to indicate "all jars in
>>>> directory" which I find useful in such cases to avoid having to
>>>> enumerate jars individually.
>>>>
>>>> Regards,
>>>>
>>>> -chaw
>>>>
>>>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-10-29  7:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-28 12:56 How to access JavaFx class library from Kawa? Arie van Wingerden
2018-10-28 13:43 ` Sudarshan S Chawathe
2018-10-28 14:21   ` Arie van Wingerden
2018-10-28 15:18     ` Sudarshan S Chawathe
2018-10-28 15:19     ` Arie van Wingerden
2018-10-28 15:22       ` Arie van Wingerden
2018-10-29  7:22         ` Arie van Wingerden

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