Skip to content

Debug, build and distribute

To run or build a project created with the jMonkeyEngine Initializer, install JDK 21 and run the commands below from the project directory. On Windows PowerShell, use .\gradlew.bat instead of ./gradlew.

Put your game assets in game-assets/src/main/assets/. Each platform packages them in the appropriate way.

Debug

Use these tasks to run a development build. The corresponding platform must have been selected in the Initializer.

Desktop

Run the game on your computer:

./gradlew :platform-desktop:run

You can also run the generated desktop launcher from your IDE using its debugger.

Android

Start an Android emulator or connect a device with USB debugging enabled. With the Android SDK installed, build and install the debug app:

./gradlew :platform-android:installDebug

Open the installed app on the emulator or device. You can also launch and debug it from an Android-compatible IDE.

iOS

On a Mac with Xcode and an installed iOS Simulator runtime, run the debug app in the simulator:

./gradlew :platform-ios:runIosDebugApp -PiosAppTarget=simulator

For a connected device, use -PiosAppTarget=device and configure your Apple Developer team and device signing.

Release

Choose the release for your platform and distribution channel.

Desktop Standalone

Choose a standalone release to distribute your game directly to players. For example, to build for Linux x64:

./gradlew :platform-desktop:releaseDesktop -PjmeReleaseProfile=standalone -PjmeReleaseTarget=linux-x64

Replace linux-x64 with the target you need:

Target Platform
windows-x64 Windows x64
linux-x64 Linux x64
linux-arm64 Linux ARM64
macos-x64 macOS Intel
macos-arm64 macOS Apple Silicon
linux-proton-x64 Linux x64, running the Windows build through Proton

The platform must have been selected in the Initializer. To use linux-proton-x64, select Windows when creating the project. The release includes Java and is created under platform-desktop/build/releases/<profile>/<target>/.

On Linux, start the game using the launcher named after your project. For example, a project named My Game uses ./my-game. The standalone Linux launcher requires Python 3.10 or later and tar with XZ and gzip support.

Desktop Steam or similar platforms

Choose this release to prepare your game for a Steam depot or a similar distribution platform. For example, to build for Windows x64:

./gradlew :platform-desktop:releaseDesktop -PjmeReleaseProfile=steam -PjmeReleaseTarget=windows-x64

Replace windows-x64 with the target you need:

Target Platform
windows-x64 Windows x64
linux-x64 Linux x64
linux-arm64 Linux ARM64
macos-x64 macOS Intel
macos-arm64 macOS Apple Silicon

The platform must have been selected in the Initializer. For Steam Proton, use windows-x64 and let Steam launch the Windows release. The release includes Java and is created under platform-desktop/build/releases/<profile>/<target>/; upload this directory to the appropriate depot.

Signing and notarizing a macOS release

For distribution outside the Mac App Store, sign and notarize the generated .app on a Mac with Xcode. If you built it on another system, transfer the app to the Mac while preserving its permissions and symbolic links. These steps apply to both desktop release profiles.

First, sign the bundled JVM, native code and outer app from the inside out with a Developer ID Application certificate, Hardened Runtime and a secure timestamp. Check that the signed app starts and loads its native libraries. See Apple's distribution signing guide.

Store your notarization credentials in the macOS keychain once:

xcrun notarytool store-credentials game-notary

After signing, replace the example path with the path to your app, then verify and submit it:

app="/path/to/My Game.app"
codesign --verify --deep --strict "$app"
ditto -c -k --keepParent "$app" "${app%.app}-notary.zip"
xcrun notarytool submit "${app%.app}-notary.zip" --keychain-profile game-notary --wait

When Apple reports Accepted, attach and validate the notarization ticket, then create the ZIP for distribution:

xcrun stapler staple "$app"
xcrun stapler validate "$app"
ditto -c -k --keepParent "$app" "${app%.app}.zip"

Test the finished ZIP on a Mac with Gatekeeper enabled. For more details, see Apple's notarization workflow. The release task also prints these steps after a macOS build.

Android

Install the Android SDK, then build an APK or an Android App Bundle:

# APK for direct distribution
./gradlew :platform-android:assembleRelease

# App Bundle for Google Play, with assets in an install-time asset pack
./gradlew :platform-android:bundleRelease -PjmePlayAssets=true

Find the result under platform-android/build/outputs/. Configure release signing with your own key before distributing it.

iOS

On a Mac with Xcode installed, configure your Apple Developer team and signing, then build the release IPA:

./gradlew :platform-ios:buildIosApp

Find the IPA under platform-ios/build/ios-release/. For reflection and native-image configuration, see iOS reflection; for signing and provisioning options, see the libJGLIOS documentation.