Skip to content

Commit 381c26f

Browse files
committed
Handle macOS ARM JDK 8 and skip Android javadocs
1 parent 1315702 commit 381c26f

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

BUILDING.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Building Codename One
22

3-
This guide explains how to build Codename One and its Android and iOS ports locally with Maven.
3+
This guide provides reproducible steps to build Codename One locally with Maven, including its Android and iOS ports.
44

55
## Prerequisites
66

@@ -9,7 +9,8 @@ This guide explains how to build Codename One and its Android and iOS ports loca
99
- **Apache Maven 3.6+**
1010
- macOS with Xcode (required only for the iOS port)
1111

12-
The helper scripts in the `scripts/` directory download these dependencies when they are not already installed.
12+
The helper scripts in the `scripts/` directory download these dependencies when they are not already installed. On Apple Silicon
13+
macOS machines, the scripts download the Intel JDK 8 and run it via Rosetta because an ARM build of JDK 8 is unavailable.
1314

1415
### Installing JDKs on Linux
1516

@@ -44,7 +45,8 @@ The script runs `mvn install` in `maven/`, installs `cn1-maven-archetypes`, and
4445

4546
## Building the Android port
4647

47-
The Android port uses JDK 17 for compilation while Maven runs with JDK 8. Run the build script:
48+
The Android port uses JDK 17 for compilation while Maven runs with JDK 8. Javadoc generation is skipped to avoid known Maven
49+
report issues. Run the build script:
4850

4951
```bash
5052
./scripts/build-android-port.sh -DskipTests

scripts/build-android-port.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ if [ ! -f "$BUILD_CLIENT" ]; then
4040
fi
4141
fi
4242

43-
"$MAVEN_HOME/bin/mvn" -q -f maven/pom.xml -pl android -am clean install "$@"
43+
"$MAVEN_HOME/bin/mvn" -q -f maven/pom.xml -pl android -am -Dmaven.javadoc.skip=true clean install "$@"

scripts/setup-workspace.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,17 @@ case "$arch_name" in
2121
x86_64|amd64) arch="x64" ;;
2222
arm64|aarch64) arch="aarch64" ;;
2323
*) echo "Unsupported architecture: $arch_name" >&2; exit 1 ;;
24-
esac
24+
esac
25+
26+
# JDK 8 is not available for Apple Silicon. Use the Intel build when running on macOS ARM.
27+
jdk8_arch="$arch"
28+
jdk17_arch="$arch"
29+
if [ "$os" = "mac" ] && [ "$arch" = "aarch64" ]; then
30+
jdk8_arch="x64"
31+
fi
2532

26-
JDK8_URL="https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u462-b08/OpenJDK8U-jdk_${arch}_${os}_hotspot_8u462b08.tar.gz"
27-
JDK17_URL="https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.16%2B8/OpenJDK17U-jdk_${arch}_${os}_hotspot_17.0.16_8.tar.gz"
33+
JDK8_URL="https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u462-b08/OpenJDK8U-jdk_${jdk8_arch}_${os}_hotspot_8u462b08.tar.gz"
34+
JDK17_URL="https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.16%2B8/OpenJDK17U-jdk_${jdk17_arch}_${os}_hotspot_17.0.16_8.tar.gz"
2835
MAVEN_URL="https://archive.apache.org/dist/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz"
2936

3037
install_jdk() {

0 commit comments

Comments
 (0)