I wanna export my app to PC and Android devices. If i create a JavaFX project with sdk 13.0 and try to export as a JavaFX application it says fx:deploy not supported. So i tried gluon plugin. But when i open a project i cant run even the empty scene. I found one tutorial on the internet how to do that, but he had inside the build.grandle some long settings, and i have only one line
apply plugin: 'base'
And i get this error every time
The project uses Gradle 4.3.1 which is incompatible with Java 10 or newer.
What is the easiest way to export java app to exe or apk ?
Creating an installer for the desktop platforms (Windows, macOS, Linux) has become easy these days. The tool of choice is jpackage which started to be shipped with JDK 14. It can either be used on the command line on the finished project or you can use a Gradle plugin (https://github.com/beryx/badass-jlink-plugin). If your project is not modularized you could follow this tutorial https://github.com/dlemmermann/JPackageScriptFX which also uses jpackage but together with Maven and some other tools from the JDK. The Maven part could easily be rewritten to Gradle, if needed.
Building for Android or iOS is another story. You will need the Gluon client-gradle-plugin (https://github.com/gluonhq/client-gradle-plugin) to do that. But I think it is rather naive to believe that an application which is written for the desktop can be used one to one on a mobile platform. Technically this would work for a hello-world like demo but not for a real application just because your environment, the form-factor and many other things are just different. So you will have to adjust your project to accommodate for that.