Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Davide Perini

Done it here.

https://github.com/sblantipodi/JavaFastScreenCapture/blob/JavaFXJavaModule/pom.xml

If you read my sources there is how to configure the maven pom.
You need then create a simple class with a main that doesn't extends 
application that simply call the main in the class that extends application.


Hope it helped

In data 20 luglio 2020 21:25:23 Davide Perini 
 ha scritto:



PS: I add that I'm not new to maven,
before java fx, I had a fat jar with gstreamer library, jna, and so on.

the only problem I have is that it seems that I'm not able to bundle
javafx with my fat jar.



Il 20/07/2020 20.55, Davide Perini ha scritto:

I agree, don't want to download a JDK.
Is there a way to simply to it the old but good way using maven
assembly plugin or shade plugin?

I am following this guide here:
https://openjfx.io/openjfx-docs/#modular

I have done what they suggest in my pom file:

 org.openjfx
javafx-controls
${javafx.version}  
org.openjfx javafx-fxml
${javafx.version}  
org.openjfx
javafx-graphics 14
win 


 org.openjfx
javafx-maven-plugin
${javafx.maven.plugin.version} 
org.dpsoftware.FastScreenCapture
  
org.apache.maven.plugins
maven-assembly-plugin 
${project.build.directory}/
JavaFastScreenCapture 
 
make-executable-jar-with-dependencies package
 single   
 true
org.dpsoftware.FastScreenCapture 
 
jar-with-dependencies 
   


jar with dependencies says

Error: JavaFX runtime components are missing, and are required to run
this application


still don't understand how to do it the right way.
I would like to do it with maven, is this possible?

Thanks,
Davide

Il 20/07/2020 20.26, Scott Palmer ha scritto:

jlink and jdeps are module-based, so you do have to be careful.
Neither will work properly when you try to run it against a
non-modular project (found that out the hard way when Java 11 broke
the world by removing the EE modules from Java SE and no modules were
available to replace them), but you can use them to make a JRE image
from a set of modules, such as those supplied by OpenJFX.

I still think the .jmod files should be hosted by artifact
repositories to make this work smoothly.  Downloading an SDK, seems
so old-school when we have good dependency-management tools.

Once you have a JRE image that includes JavaFX, then your application
Jar files (all of them, no need to make anything 'fat') can easily be
bundled with that JRE using jpackage.

I have done Gradle scripts to do all that and it wasn’t difficult.

Scott


On Jul 20, 2020, at 1:39 PM, Michael Paus  wrote:

In order to create a real platform installer with jpackage and
jlink/jdeps you don't have to use the java
module system at all. Have a look at this tutorial which I
co-autored together with Dirk Lemmermann:

Michael

Am 20.07.20 um 19:25 schrieb Davide Perini:

Unfortunantly so few dependencies supports Java Modules this day,
so fat JAR is the only way I can do it.

Thanks

Il 20/07/2020 02.50, Scott Palmer ha scritto:

The JavaFX classes are there, but what about the native libraries?

A fat jar isn’t a good way to distribute a Java application these
days. Now you should probably be using jpackage and/or jlink to
bundle your application classes with a runtime suitable for
running the application.

Scott


On Jul 19, 2020, at 5:32 PM, Davide Perini
 wrote:

Hi all,
thanks for the great project, I love JavaFX.

I always used the maven plugin to crete fat jars with all my
deps. The resulting jar is an executable one and ready to use.

This is my pom that create the fat jar.

but when I try to exceute the jar I get this error:

Error: JavaFX runtime components are missing, and are required to
run this appli
cation


if I explode the fat jar I can see that there are the javafx
class in it. what am I doing wrong?

Thanks
Davide

 org.openjfx
javafx-maven-plugin
${javafx.maven.plugin.version} 
org.dpsoftware.FastScreenCapture
  
org.apache.maven.plugins
maven-assembly-plugin 
${project.build.directory}/
JavaFastScreenCapture 
 
make-executable-jar-with-dependencies
package  single 
  
true
org.dpsoftware.FastScreenCapture
  
jar-with-dependencies
   








Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Davide Perini

PS: I add that I'm not new to maven,
before java fx, I had a fat jar with gstreamer library, jna, and so on.

the only problem I have is that it seems that I'm not able to bundle 
javafx with my fat jar.




Il 20/07/2020 20.55, Davide Perini ha scritto:

I agree, don't want to download a JDK.
Is there a way to simply to it the old but good way using maven 
assembly plugin or shade plugin?


I am following this guide here:
https://openjfx.io/openjfx-docs/#modular

I have done what they suggest in my pom file:

 org.openjfx 
javafx-controls 
${javafx.version}   
org.openjfx javafx-fxml 
${javafx.version}   
org.openjfx 
javafx-graphics 14 
win 



 org.openjfx 
javafx-maven-plugin 
${javafx.maven.plugin.version}  
org.dpsoftware.FastScreenCapture 
   
org.apache.maven.plugins 
maven-assembly-plugin  
${project.build.directory}/ 
JavaFastScreenCapture  
  
make-executable-jar-with-dependencies package 
 single
 true 
org.dpsoftware.FastScreenCapture  
  
jar-with-dependencies  
   



jar with dependencies says

Error: JavaFX runtime components are missing, and are required to run 
this application



still don't understand how to do it the right way.
I would like to do it with maven, is this possible?

Thanks,
Davide

Il 20/07/2020 20.26, Scott Palmer ha scritto:
jlink and jdeps are module-based, so you do have to be careful.  
Neither will work properly when you try to run it against a 
non-modular project (found that out the hard way when Java 11 broke 
the world by removing the EE modules from Java SE and no modules were 
available to replace them), but you can use them to make a JRE image 
from a set of modules, such as those supplied by OpenJFX.


I still think the .jmod files should be hosted by artifact 
repositories to make this work smoothly.  Downloading an SDK, seems 
so old-school when we have good dependency-management tools.


Once you have a JRE image that includes JavaFX, then your application 
Jar files (all of them, no need to make anything 'fat') can easily be 
bundled with that JRE using jpackage.


I have done Gradle scripts to do all that and it wasn’t difficult.

Scott


On Jul 20, 2020, at 1:39 PM, Michael Paus  wrote:

In order to create a real platform installer with jpackage and 
jlink/jdeps you don't have to use the java
module system at all. Have a look at this tutorial which I 
co-autored together with Dirk Lemmermann:


Michael

Am 20.07.20 um 19:25 schrieb Davide Perini:
Unfortunantly so few dependencies supports Java Modules this day, 
so fat JAR is the only way I can do it.


Thanks

Il 20/07/2020 02.50, Scott Palmer ha scritto:

The JavaFX classes are there, but what about the native libraries?

A fat jar isn’t a good way to distribute a Java application these 
days. Now you should probably be using jpackage and/or jlink to 
bundle your application classes with a runtime suitable for 
running the application.


Scott

On Jul 19, 2020, at 5:32 PM, Davide Perini 
 wrote:


Hi all,
thanks for the great project, I love JavaFX.

I always used the maven plugin to crete fat jars with all my 
deps. The resulting jar is an executable one and ready to use.


This is my pom that create the fat jar.

but when I try to exceute the jar I get this error:

Error: JavaFX runtime components are missing, and are required to 
run this appli

cation


if I explode the fat jar I can see that there are the javafx 
class in it. what am I doing wrong?


Thanks
Davide

 org.openjfx 
javafx-maven-plugin 
${javafx.maven.plugin.version}  
org.dpsoftware.FastScreenCapture 
   
org.apache.maven.plugins 
maven-assembly-plugin  
${project.build.directory}/ 
JavaFastScreenCapture  
  
make-executable-jar-with-dependencies 
package  single  
   
true 
org.dpsoftware.FastScreenCapture 
   
jar-with-dependencies 










Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Ty Young

Don't know anything about fat jars, but you could try this jlink plugin:


https://tentackle.org/static-content/sitedocs/tentackle/latest/tentackle-jlink-maven-plugin/jlink-mojo.html


It works with non-modular projects as well - everything just gets dumped 
into a folder and put onto the module path. Just follow the standard 
Maven jlink guide:



https://maven.apache.org/plugins/maven-jlink-plugin/usage.html


but use the above plugin instead. I've been using it and it works great.


Hope this helps.



Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Davide Perini

Ok solved it reading this stackoverflow:
https://stackoverflow.com/questions/52653836/maven-shade-javafx-runtime-components-are-missing

thanks to all

Il 20/07/2020 20.55, Davide Perini ha scritto:

I agree, don't want to download a JDK.
Is there a way to simply to it the old but good way using maven 
assembly plugin or shade plugin?


I am following this guide here:
https://openjfx.io/openjfx-docs/#modular

I have done what they suggest in my pom file:

 org.openjfx 
javafx-controls 
${javafx.version}   
org.openjfx javafx-fxml 
${javafx.version}   
org.openjfx 
javafx-graphics 14 
win 



 org.openjfx 
javafx-maven-plugin 
${javafx.maven.plugin.version}  
org.dpsoftware.FastScreenCapture 
   
org.apache.maven.plugins 
maven-assembly-plugin  
${project.build.directory}/ 
JavaFastScreenCapture  
  
make-executable-jar-with-dependencies package 
 single
 true 
org.dpsoftware.FastScreenCapture  
  
jar-with-dependencies  
   



jar with dependencies says

Error: JavaFX runtime components are missing, and are required to run 
this application



still don't understand how to do it the right way.
I would like to do it with maven, is this possible?

Thanks,
Davide

Il 20/07/2020 20.26, Scott Palmer ha scritto:
jlink and jdeps are module-based, so you do have to be careful.  
Neither will work properly when you try to run it against a 
non-modular project (found that out the hard way when Java 11 broke 
the world by removing the EE modules from Java SE and no modules were 
available to replace them), but you can use them to make a JRE image 
from a set of modules, such as those supplied by OpenJFX.


I still think the .jmod files should be hosted by artifact 
repositories to make this work smoothly.  Downloading an SDK, seems 
so old-school when we have good dependency-management tools.


Once you have a JRE image that includes JavaFX, then your application 
Jar files (all of them, no need to make anything 'fat') can easily be 
bundled with that JRE using jpackage.


I have done Gradle scripts to do all that and it wasn’t difficult.

Scott


On Jul 20, 2020, at 1:39 PM, Michael Paus  wrote:

In order to create a real platform installer with jpackage and 
jlink/jdeps you don't have to use the java
module system at all. Have a look at this tutorial which I 
co-autored together with Dirk Lemmermann:


Michael

Am 20.07.20 um 19:25 schrieb Davide Perini:
Unfortunantly so few dependencies supports Java Modules this day, 
so fat JAR is the only way I can do it.


Thanks

Il 20/07/2020 02.50, Scott Palmer ha scritto:

The JavaFX classes are there, but what about the native libraries?

A fat jar isn’t a good way to distribute a Java application these 
days. Now you should probably be using jpackage and/or jlink to 
bundle your application classes with a runtime suitable for 
running the application.


Scott

On Jul 19, 2020, at 5:32 PM, Davide Perini 
 wrote:


Hi all,
thanks for the great project, I love JavaFX.

I always used the maven plugin to crete fat jars with all my 
deps. The resulting jar is an executable one and ready to use.


This is my pom that create the fat jar.

but when I try to exceute the jar I get this error:

Error: JavaFX runtime components are missing, and are required to 
run this appli

cation


if I explode the fat jar I can see that there are the javafx 
class in it. what am I doing wrong?


Thanks
Davide

 org.openjfx 
javafx-maven-plugin 
${javafx.maven.plugin.version}  
org.dpsoftware.FastScreenCapture 
   
org.apache.maven.plugins 
maven-assembly-plugin  
${project.build.directory}/ 
JavaFastScreenCapture  
  
make-executable-jar-with-dependencies 
package  single  
   
true 
org.dpsoftware.FastScreenCapture 
   
jar-with-dependencies 










Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Davide Perini

I agree, don't want to download a JDK.
Is there a way to simply to it the old but good way using maven assembly 
plugin or shade plugin?


I am following this guide here:
https://openjfx.io/openjfx-docs/#modular

I have done what they suggest in my pom file:

 org.openjfx javafx-controls ${javafx.version}   
org.openjfx javafx-fxml ${javafx.version}   org.openjfx 
javafx-graphics 14 win 


 org.openjfx javafx-maven-plugin ${javafx.maven.plugin.version}  org.dpsoftware.FastScreenCaptureorg.apache.maven.plugins maven-assembly-plugin  ${project.build.directory}/ JavaFastScreenCapturemake-executable-jar-with-dependencies package  single true org.dpsoftware.FastScreenCapturejar-with-dependencies
 



jar with dependencies says

Error: JavaFX runtime components are missing, and are required to run 
this application



still don't understand how to do it the right way.
I would like to do it with maven, is this possible?

Thanks,
Davide

Il 20/07/2020 20.26, Scott Palmer ha scritto:

jlink and jdeps are module-based, so you do have to be careful.  Neither will 
work properly when you try to run it against a non-modular project (found that 
out the hard way when Java 11 broke the world by removing the EE modules from 
Java SE and no modules were available to replace them), but you can use them to 
make a JRE image from a set of modules, such as those supplied by OpenJFX.

I still think the .jmod files should be hosted by artifact repositories to make 
this work smoothly.  Downloading an SDK, seems so old-school when we have good 
dependency-management tools.

Once you have a JRE image that includes JavaFX, then your application Jar files 
(all of them, no need to make anything 'fat') can easily be bundled with that 
JRE using jpackage.

I have done Gradle scripts to do all that and it wasn’t difficult.

Scott


On Jul 20, 2020, at 1:39 PM, Michael Paus  wrote:

In order to create a real platform installer with jpackage and jlink/jdeps you 
don't have to use the java
module system at all. Have a look at this tutorial which I co-autored together 
with Dirk Lemmermann:

Michael

Am 20.07.20 um 19:25 schrieb Davide Perini:

Unfortunantly so few dependencies supports Java Modules this day, so fat JAR is 
the only way I can do it.

Thanks

Il 20/07/2020 02.50, Scott Palmer ha scritto:

The JavaFX classes are there, but what about the native libraries?

A fat jar isn’t a good way to distribute a Java application these days. Now you 
should probably be using jpackage and/or jlink to bundle your application 
classes with a runtime suitable for running the application.

Scott


On Jul 19, 2020, at 5:32 PM, Davide Perini  wrote:

Hi all,
thanks for the great project, I love JavaFX.

I always used the maven plugin to crete fat jars with all my deps. The 
resulting jar is an executable one and ready to use.

This is my pom that create the fat jar.

but when I try to exceute the jar I get this error:

Error: JavaFX runtime components are missing, and are required to run this appli
cation


if I explode the fat jar I can see that there are the javafx class in it. what 
am I doing wrong?

Thanks
Davide

 org.openjfx javafx-maven-plugin ${javafx.maven.plugin.version}  org.dpsoftware.FastScreenCaptureorg.apache.maven.plugins 
maven-assembly-plugin  ${project.build.directory}/ JavaFastScreenCapturemake-executable-jar-with-dependencies package 
 single true org.dpsoftware.FastScreenCapturejar-with-dependencies  
   





Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Scott Palmer
jlink and jdeps are module-based, so you do have to be careful.  Neither will 
work properly when you try to run it against a non-modular project (found that 
out the hard way when Java 11 broke the world by removing the EE modules from 
Java SE and no modules were available to replace them), but you can use them to 
make a JRE image from a set of modules, such as those supplied by OpenJFX.

I still think the .jmod files should be hosted by artifact repositories to make 
this work smoothly.  Downloading an SDK, seems so old-school when we have good 
dependency-management tools.

Once you have a JRE image that includes JavaFX, then your application Jar files 
(all of them, no need to make anything 'fat') can easily be bundled with that 
JRE using jpackage.

I have done Gradle scripts to do all that and it wasn’t difficult.

Scott

> On Jul 20, 2020, at 1:39 PM, Michael Paus  wrote:
> 
> In order to create a real platform installer with jpackage and jlink/jdeps 
> you don't have to use the java
> module system at all. Have a look at this tutorial which I co-autored 
> together with Dirk Lemmermann:
> 
> Michael
> 
> Am 20.07.20 um 19:25 schrieb Davide Perini:
>> Unfortunantly so few dependencies supports Java Modules this day, so fat JAR 
>> is the only way I can do it.
>> 
>> Thanks
>> 
>> Il 20/07/2020 02.50, Scott Palmer ha scritto:
>>> The JavaFX classes are there, but what about the native libraries?
>>> 
>>> A fat jar isn’t a good way to distribute a Java application these days. Now 
>>> you should probably be using jpackage and/or jlink to bundle your 
>>> application classes with a runtime suitable for running the application.
>>> 
>>> Scott
>>> 
 On Jul 19, 2020, at 5:32 PM, Davide Perini  
 wrote:
 
 Hi all,
 thanks for the great project, I love JavaFX.
 
 I always used the maven plugin to crete fat jars with all my deps. The 
 resulting jar is an executable one and ready to use.
 
 This is my pom that create the fat jar.
 
 but when I try to exceute the jar I get this error:
 
 Error: JavaFX runtime components are missing, and are required to run this 
 appli
 cation
 
 
 if I explode the fat jar I can see that there are the javafx class in it. 
 what am I doing wrong?
 
 Thanks
 Davide
 
  org.openjfx 
 javafx-maven-plugin 
 ${javafx.maven.plugin.version}  
 org.dpsoftware.FastScreenCapture  
   org.apache.maven.plugins 
 maven-assembly-plugin  
 ${project.build.directory}/ 
 JavaFastScreenCapture   
  make-executable-jar-with-dependencies 
 package  single  
true 
 org.dpsoftware.FastScreenCapture  
   
 jar-with-dependencies  

 



Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Michael Paus

Am 20.07.20 um 19:40 schrieb Nir Lisker:

In addition to the other answers, you can look into GraalVM's native image:
https://www.graalvm.org/docs/reference-manual/native-image/

GraalVM native-image does not work directly with JavaFX. You would have to
use the Gluon client-maven-plugin 

to get that going but I would not recommend that as a first try because 
it is just too difficult.

You can try that step later.


On Mon, Jul 20, 2020 at 8:25 PM Davide Perini 
wrote:


Unfortunantly so few dependencies supports Java Modules this day, so fat
JAR is the only way I can do it.

Thanks

Il 20/07/2020 02.50, Scott Palmer ha scritto:

The JavaFX classes are there, but what about the native libraries?

A fat jar isn’t a good way to distribute a Java application these days.

Now you should probably be using jpackage and/or jlink to bundle your
application classes with a runtime suitable for running the application.

Scott


On Jul 19, 2020, at 5:32 PM, Davide Perini <

perini.dav...@dpsoftware.org> wrote:

Hi all,
thanks for the great project, I love JavaFX.

I always used the maven plugin to crete fat jars with all my deps. The

resulting jar is an executable one and ready to use.

This is my pom that create the fat jar.

but when I try to exceute the jar I get this error:

Error: JavaFX runtime components are missing, and are required to run

this appli

cation


if I explode the fat jar I can see that there are the javafx class in

it. what am I doing wrong?

Thanks
Davide

 org.openjfx

javafx-maven-plugin
${javafx.maven.plugin.version} 
org.dpsoftware.FastScreenCapture 
  org.apache.maven.plugins
maven-assembly-plugin 
${project.build.directory}/
JavaFastScreenCapture  
 make-executable-jar-with-dependencies
package  single  
  true
org.dpsoftware.FastScreenCapture 
 
jar-with-dependencies 
   





Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Nir Lisker
Hi,

Unfortunantly so few dependencies supports Java Modules this day


All the ones I know of do. Here's a list of modules on Maven Central:
https://github.com/sormuras/modules

so fat JAR is the only way I can do it.
>

In addition to the other answers, you can look into GraalVM's native image:
https://www.graalvm.org/docs/reference-manual/native-image/

On Mon, Jul 20, 2020 at 8:25 PM Davide Perini 
wrote:

> Unfortunantly so few dependencies supports Java Modules this day, so fat
> JAR is the only way I can do it.
>
> Thanks
>
> Il 20/07/2020 02.50, Scott Palmer ha scritto:
> > The JavaFX classes are there, but what about the native libraries?
> >
> > A fat jar isn’t a good way to distribute a Java application these days.
> Now you should probably be using jpackage and/or jlink to bundle your
> application classes with a runtime suitable for running the application.
> >
> > Scott
> >
> >> On Jul 19, 2020, at 5:32 PM, Davide Perini <
> perini.dav...@dpsoftware.org> wrote:
> >>
> >> Hi all,
> >> thanks for the great project, I love JavaFX.
> >>
> >> I always used the maven plugin to crete fat jars with all my deps. The
> resulting jar is an executable one and ready to use.
> >>
> >> This is my pom that create the fat jar.
> >>
> >> but when I try to exceute the jar I get this error:
> >>
> >> Error: JavaFX runtime components are missing, and are required to run
> this appli
> >> cation
> >>
> >>
> >> if I explode the fat jar I can see that there are the javafx class in
> it. what am I doing wrong?
> >>
> >> Thanks
> >> Davide
> >>
> >>  org.openjfx
> javafx-maven-plugin
> ${javafx.maven.plugin.version} 
> org.dpsoftware.FastScreenCapture 
>   org.apache.maven.plugins
> maven-assembly-plugin 
> ${project.build.directory}/
> JavaFastScreenCapture  
>  make-executable-jar-with-dependencies
> package  single  
>   true
> org.dpsoftware.FastScreenCapture 
>  
> jar-with-dependencies 
>
> >>
>
>


Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Michael Paus
In order to create a real platform installer with jpackage and 
jlink/jdeps you don't have to use the java
module system at all. Have a look at this tutorial which I co-autored 
together with Dirk Lemmermann:


Michael

Am 20.07.20 um 19:25 schrieb Davide Perini:
Unfortunantly so few dependencies supports Java Modules this day, so 
fat JAR is the only way I can do it.


Thanks

Il 20/07/2020 02.50, Scott Palmer ha scritto:

The JavaFX classes are there, but what about the native libraries?

A fat jar isn’t a good way to distribute a Java application these 
days. Now you should probably be using jpackage and/or jlink to 
bundle your application classes with a runtime suitable for running 
the application.


Scott

On Jul 19, 2020, at 5:32 PM, Davide Perini 
 wrote:


Hi all,
thanks for the great project, I love JavaFX.

I always used the maven plugin to crete fat jars with all my deps. 
The resulting jar is an executable one and ready to use.


This is my pom that create the fat jar.

but when I try to exceute the jar I get this error:

Error: JavaFX runtime components are missing, and are required to 
run this appli

cation


if I explode the fat jar I can see that there are the javafx class 
in it. what am I doing wrong?


Thanks
Davide

 org.openjfx 
javafx-maven-plugin 
${javafx.maven.plugin.version}  
org.dpsoftware.FastScreenCapture 
   
org.apache.maven.plugins 
maven-assembly-plugin  
${project.build.directory}/ 
JavaFastScreenCapture  
  
make-executable-jar-with-dependencies 
package  single  
   
true 
org.dpsoftware.FastScreenCapture  
  
jar-with-dependencies 









Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Davide Perini

Hi,
thanks for the answer, I appreciate it.

I am trying with jpackage (that bundles my fat jar with some more dlls),
but when I try to run my app I get this error:
Error: JavaFX runtime components are missing, and are required to run 
this application


Any idea?

Thanks



Il 20/07/2020 19.30, Matthias Bläsing ha scritto:

Hi,

Am Montag, den 20.07.2020, 19:25 +0200 schrieb Davide Perini:

Unfortunantly so few dependencies supports Java Modules this day, so
fat JAR is the only way I can do it.

no it is not. There are seveal ways how to bundle native libraries.
jpackage is one way, fat jars are another. And for fat jars of course
you can extract native libraries at runtime (JNA does exactly that).
What is difficult is the handling of native dependencies. If you know
what you are doing you can manually load native libraries in the right
order.

The alternative is to distribute a ZIP file and setup the paths prior
to loading libraries. Changing the java.library.path takes some
reflection, but it is possible to do at runtime.

The javafx jars from maven central hold the native libraries.

Matthias





Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Matthias Bläsing
Hi,

Am Montag, den 20.07.2020, 19:25 +0200 schrieb Davide Perini:
> Unfortunantly so few dependencies supports Java Modules this day, so
> fat JAR is the only way I can do it.

no it is not. There are seveal ways how to bundle native libraries.
jpackage is one way, fat jars are another. And for fat jars of course
you can extract native libraries at runtime (JNA does exactly that).
What is difficult is the handling of native dependencies. If you know
what you are doing you can manually load native libraries in the right
order.

The alternative is to distribute a ZIP file and setup the paths prior
to loading libraries. Changing the java.library.path takes some
reflection, but it is possible to do at runtime.

The javafx jars from maven central hold the native libraries.

Matthias



Re: How to create a fat jar for my JavaFX program?

2020-07-20 Thread Davide Perini
Unfortunantly so few dependencies supports Java Modules this day, so fat 
JAR is the only way I can do it.


Thanks

Il 20/07/2020 02.50, Scott Palmer ha scritto:

The JavaFX classes are there, but what about the native libraries?

A fat jar isn’t a good way to distribute a Java application these days. Now you 
should probably be using jpackage and/or jlink to bundle your application 
classes with a runtime suitable for running the application.

Scott


On Jul 19, 2020, at 5:32 PM, Davide Perini  wrote:

Hi all,
thanks for the great project, I love JavaFX.

I always used the maven plugin to crete fat jars with all my deps. The 
resulting jar is an executable one and ready to use.

This is my pom that create the fat jar.

but when I try to exceute the jar I get this error:

Error: JavaFX runtime components are missing, and are required to run this appli
cation


if I explode the fat jar I can see that there are the javafx class in it. what 
am I doing wrong?

Thanks
Davide

 org.openjfx javafx-maven-plugin ${javafx.maven.plugin.version}  org.dpsoftware.FastScreenCaptureorg.apache.maven.plugins 
maven-assembly-plugin  ${project.build.directory}/ JavaFastScreenCapturemake-executable-jar-with-dependencies package 
 single true org.dpsoftware.FastScreenCapturejar-with-dependencies  
   





Re: How to create a fat jar for my JavaFX program?

2020-07-19 Thread Julian Jupiter
I'm using maven-shade-plugin:


org.apache.maven.plugins
maven-shade-plugin
3.2.4

true


*:*

META-INF/*.SF
META-INF/*.DSA
META-INF/*.RSA






package

shade


false



package.to.Main







On Mon, Jul 20, 2020, 5:32 AM Davide Perini, 
wrote:

> Hi all,
> thanks for the great project, I love JavaFX.
>
> I always used the maven plugin to crete fat jars with all my deps. The
> resulting jar is an executable one and ready to use.
>
> This is my pom that create the fat jar.
>
> but when I try to exceute the jar I get this error:
>
> Error: JavaFX runtime components are missing, and are required to run
> this appli
> cation
>
>
> if I explode the fat jar I can see that there are the javafx class in
> it. what am I doing wrong?
>
> Thanks
> Davide
>
>  org.openjfx
> javafx-maven-plugin
> ${javafx.maven.plugin.version} 
> org.dpsoftware.FastScreenCapture 
>   org.apache.maven.plugins
> maven-assembly-plugin 
> ${project.build.directory}/
> JavaFastScreenCapture  
>  make-executable-jar-with-dependencies
> package  single  
>   true
> org.dpsoftware.FastScreenCapture 
>  
> jar-with-dependencies 
>  
>  
>
>


Re: How to create a fat jar for my JavaFX program?

2020-07-19 Thread Scott Palmer
The JavaFX classes are there, but what about the native libraries?

A fat jar isn’t a good way to distribute a Java application these days. Now you 
should probably be using jpackage and/or jlink to bundle your application 
classes with a runtime suitable for running the application. 

Scott

> On Jul 19, 2020, at 5:32 PM, Davide Perini  
> wrote:
> 
> Hi all,
> thanks for the great project, I love JavaFX.
> 
> I always used the maven plugin to crete fat jars with all my deps. The 
> resulting jar is an executable one and ready to use.
> 
> This is my pom that create the fat jar.
> 
> but when I try to exceute the jar I get this error:
> 
> Error: JavaFX runtime components are missing, and are required to run this 
> appli
> cation
> 
> 
> if I explode the fat jar I can see that there are the javafx class in it. 
> what am I doing wrong?
> 
> Thanks
> Davide
> 
>  org.openjfx 
> javafx-maven-plugin 
> ${javafx.maven.plugin.version}  
> org.dpsoftware.FastScreenCapture  
>   org.apache.maven.plugins 
> maven-assembly-plugin  
> ${project.build.directory}/ 
> JavaFastScreenCapture   
>  make-executable-jar-with-dependencies 
> package  single   
>   true 
> org.dpsoftware.FastScreenCapture  
>   
> jar-with-dependencies  
>
> 


How to create a fat jar for my JavaFX program?

2020-07-19 Thread Davide Perini

Hi all,
thanks for the great project, I love JavaFX.

I always used the maven plugin to crete fat jars with all my deps. The 
resulting jar is an executable one and ready to use.


This is my pom that create the fat jar.

but when I try to exceute the jar I get this error:

Error: JavaFX runtime components are missing, and are required to run 
this appli

cation


if I explode the fat jar I can see that there are the javafx class in 
it. what am I doing wrong?


Thanks
Davide

 org.openjfx javafx-maven-plugin ${javafx.maven.plugin.version}  org.dpsoftware.FastScreenCaptureorg.apache.maven.plugins maven-assembly-plugin  ${project.build.directory}/ JavaFastScreenCapturemake-executable-jar-with-dependencies package  single true org.dpsoftware.FastScreenCapturejar-with-dependencies