0

Following this question Gluon Mobile project does not work with gradle 6, I want to know how to ship an application that uses gluon mobile and Java 14.

From what I read, gluon mobile only supports Java 14 if I use GraalVM with the client plugin (https://github.com/gluonhq/client-maven-plugin or https://github.com/gluonhq/client-gradle-plugin). I read https://github.com/dlemmermann/JPackageScriptFX to learn how to package a JavaFX app, but I don't think it's compatible with GraalVM's native image.

So it looks like I'm stuck. I can't use jpackage/link script above because I can't use Java 14, and if I use the client plugin with GraalVM to be able to use Java14, I can't use the jpackage/link script. How do I ship then?

Can I just ship a zip/jar with my whole gluon mobile app and the JDK module deps maybe? Then I won't need platform specific images or packaging.

My target platforms for now are Win and Mac, at least until I figure this thing out. I'm aware that everything here is quite new, so I'm not looking for miracles.

Mark
  • 2,167
  • 4
  • 32
  • 64
  • 1
    Gluon Mobile running on Java/JavaFX 11+, but targeting only desktop, does not necessary need GraalVM. You can use the JavaFX gradle/maven plugins, and also fat jar/jlink/jpackage, like any other Java/JavaFX 11+ project. With the Client plugin you can create a native image, and just distribute an executable, but also this is the only way to deploy to mobile. – José Pereda Aug 07 '20 at 18:07
  • @JoséPereda but then I run into the problem that jfxmobile doesn't work with gradle 6 that java 14 needs. I still want a mobile application to run on desktop since we are "simulating" on a desktop what a mobile app would look like, so we need Charm. Does Charm not reply on jfxmobile if it is run on desktop? Do i just comment out the jfxmobile plugin? – Mark Aug 07 '20 at 19:38
  • 1
    You don't need jfxmobile anymore. Use one of the Client samples (like [HelloGluon](https://github.com/gluonhq/client-samples/tree/master/Maven/HelloGluon)) to get started. It uses Gluon Mobile for Java 11+, JavaFX 11+, you can run it with Java 14 and the JavaFX maven(gradle) plugin, on desktop. No need for GraalVM (yet) if you don't run the client plugin. – José Pereda Aug 07 '20 at 19:44
  • @JoséPereda Oh, so the client plugin can work without GraalVM. That was not clear from the github instructions pages. Thanks, I will try! – Mark Aug 07 '20 at 19:57
  • @JoséPereda btw do I need the org.openjfx.javafxplugin along with com.gluonhq.client-gradle-plugin? or is the former included already? – Mark Aug 07 '20 at 20:51
  • 1
    I didn't say that. The HelloGluon sample I linked includes the JavaFX plugin and the Client plugin, but you can use only the former and don't use the later. In any case, jfxmobile plugin is no longer required. – José Pereda Aug 07 '20 at 20:57
  • @Mark I still do not understand exactly what your goals are. I think you are making things more complicated than they are. I am developing a mobile application which uses gluons charm-glisten and attach libraries and during development I run that on my Mac right from the IDE. If I want to, I can later produce executables via Gluons client-maven-plugin for my Mac or Windows and Linux as well as packages for iOS or Android which I all can distribute. So, what else do you want to achieve? – mipa Aug 08 '20 at 09:59

0 Answers0