Prerequisites
- JDK 8 or higher - Required for all platforms
- Android SDK - Required for Android builds (compile SDK 35, min SDK 21)
Build Commands
Desktop (LWJGL3)
The desktop platform uses LWJGL3 as the backend.Building Runnable JARs
Create a runnable JAR file that includes all dependencies:The cross-platform JAR is about 6-7MB larger than platform-specific JARs. Use platform-specific builds for distribution to reduce file size.
lwjgl3/build/libs/SpaceEscape_AULA-{version}.jar
Run the JAR:
Android
Build an APK for Android devices:android/build/outputs/apk/
Useful Gradle Tasks
| Task | Description |
|---|---|
build | Builds sources and archives for all projects |
clean | Removes build folders with compiled classes |
lwjgl3:run | Starts the desktop application |
lwjgl3:jar | Creates a runnable JAR for desktop |
android:assembleDebug | Builds a debug APK |
test | Runs unit tests (if any) |
generateAssetList | Creates assets.txt listing all game assets |
Gradle Flags
Project Configuration
Application ID:com.pmm.games
Main class: com.pmm.games.lwjgl3.Lwjgl3Launcher
Version: Defined in gradle.properties as projectVersion
Desktop window: 640x480 pixels (configurable in Lwjgl3Launcher.java:31)
Build System Details
Desktop Build Configuration
Desktop Build Configuration
The desktop build uses:
- Backend: LWJGL3 (Lightweight Java Game Library 3)
- OpenGL: ANGLE GLES20 emulation for better compatibility
- VSync: Enabled by default
- FPS limit: Monitor refresh rate + 1
- Java compatibility: Source and target version 8
Android Build Configuration
Android Build Configuration
The Android build uses:
- Compile SDK: 35
- Target SDK: 35
- Minimum SDK: 21 (Android 5.0 Lollipop)
- ABIs supported: arm64-v8a, armeabi-v7a, x86, x86_64
- ProGuard: Enabled for release builds (code minification)
- Immersive mode: Enabled for fullscreen experience
copyAndroidNatives task.Asset Generation
The build automatically generates anassets.txt file listing all game assets during the processResources phase:
assets/ directory.
Troubleshooting
Build fails with 'Java version' error
Build fails with 'Java version' error
Ensure you’re using JDK 8 or higher:Set
JAVA_HOME to point to a valid JDK installation.Android build fails
Android build fails
Check that Android SDK is properly configured:
- Create
local.propertiesin the project root - Add:
sdk.dir=/path/to/android/sdk
ANDROID_SDK_ROOT environment variable.Out of memory during build
Out of memory during build
Increase Gradle heap size in
gradle.properties: