The javafxmobile-plugin is a gradle plugin that unifies the building of Java and JavaFX applications for different target platforms:
- desktop
- android
- ios
The easiest way to get started is by using the Gluon IDE plugin for your IDE:
Once the IDE plugin is installed, you can create a new Gluon Mobile project.
Building your project requires Java 9. Make sure to set the source and target compatibility to Java 8 to make your applications deployable on Android.
sourceCompatibility = 1.8
targetCompatibility = 1.8
-
The Android SDK command line tools, available here
-
Use the
sdkmanager
command line tool to install the following packages:ANDROID_SDK/tools/bin/sdkmanager "platform-tools" "build-tools;27.0.3" "platforms;android-25" "extras;android;m2repository" "extras;google;m2repository"
-
Define a global gradle property named ANDROID_HOME inside ~/.gradle/gradle.properties that points to the location of the Android SDK:
ANDROID_HOME=/path/to/android-sdk-directory
-
A Mac with MacOS X 10.13.2 or superior
-
Xcode 9.2 or superior, available from the Mac App Store
-
To deploy on an iOS device, the
usbmuxd
library, a cross-platform software library that talks the protocols to support iOS devices. Install it with the use of Homebrew:brew install usbmuxd
-
It is highly recommended to increase the Java stack size, by adding the following option to the
~/.gradle/gradle.properties
file:org.gradle.jvmargs=-Xms256m -Xmx4096m -Xss2m
If you create your project without the use of the IDE plugins, add the following to your
build.gradle
:
buildscript {
repositories {
jcenter()
google()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:2.0.0'
}
}
apply plugin: 'org.javafxports.jfxmobile'
Full Java 9 support is in an experimental phase and is currently only supported on iOS.
This project is licensed under the 3-Clause BSD license.