How to build Libbulletjme from source
Libbulletjme is free, open-source software.
While pre-built artifacts (including AARs and JARs) can be downloaded from the Maven Central Repository, some people prefer to build them from source.
You can also build a local copy of the documentation (website content). This is useful if you are editing the content, or if your Internet access is limited or unreliable.
JARs and native libraries
Here’s the recommended procedure:
-
Install build software:
-
a Java Development Kit (JDK), if you don’t already have one, and
-
one of the supported C++ compilers:
-
for Linux: the GNU Compiler Collection or Clang
-
for Windows: Microsoft Visual Studio
-
for macOS: Xcode
-
-
If you use GCC, you might need to install the "g++-multilib" package:
-
sudo apt install g++-multilib
-
-
-
Point the
JAVA_HOME
environment variable to your JDK installation: (The path might be something like "C:\Program Files\Java\jre1.8.0_301" or "/usr/lib/jvm/java-8-openjdk-amd64/" or "/Library/Java/JavaVirtualMachines/liberica-jdk-17-full.jdk/Contents/Home" .)-
using Bash or Zsh:
export JAVA_HOME="
path to installation"
-
using Fish:
set -g JAVA_HOME "
path to installation"
-
using Windows Command Prompt:
set JAVA_HOME="
path to installation"
-
using PowerShell:
$env:JAVA_HOME = '
path to installation'
-
-
Download and extract the Libbulletjme source code from GitHub:
-
using Git:
-
cd Libbulletjme
-
git checkout -b latest 22.0.1
-
using a web browser:
-
browse to https://github.com/stephengold/Libbulletjme/releases/latest
-
follow the "Source code (zip)" link
-
save the ZIP file
-
extract the contents of the saved ZIP file
-
cd
to the extracted directory
-
-
-
Cross-compilation using GCC requires the g++-multilib package:
-
sudo apt-get install g++-multilib
-
-
(optional) Edit the "gradle.properties" file to configure the build.
-
Run the Gradle wrapper on the desktop build script:
-
using Bash or Fish or PowerShell or Zsh:
./gradlew build
-
using Windows Command Prompt:
.\gradlew build
-
-
To build Android artifacts, you’ll need to install Android Studio and point the
ANDROID_HOME
environment variable to that installation. -
Run the Gradle wrapper on the Android build script:
-
using Bash or Fish or PowerShell or Zsh:
./gradlew -b android.gradle build
-
using Windows Command Prompt:
.\gradlew -b android.gradle build
-
After a successful build, artifacts will be found in "build/libs" (desktop) and "build/outputs/aar" (Android).
Website content
-
Download and extract the source code from GitHub:
-
cd LbjExamples
-
Edit "docs/playbook.yml" and replace "/home/sgold/NetBeansProjects/LbjExamples" with an absolute path to your checkout directory (2 places).
-
Run Antora:
-
npx antora docs/playbook.yml
-
After a successful build, the local copy of the site will be found in the "docs/build/site" directory.