Skip to content

Fix JAVA_HOME for ARM64#7

Open
Naveenksaragadam wants to merge 1 commit intojosephmachado:mainfrom
Naveenksaragadam:fix/java-home-arm64
Open

Fix JAVA_HOME for ARM64#7
Naveenksaragadam wants to merge 1 commit intojosephmachado:mainfrom
Naveenksaragadam:fix/java-home-arm64

Conversation

@Naveenksaragadam
Copy link

Title:
Fix JAVA_HOME for ARM64 (Mac M-series) architecture

Description:
This PR fixes an issue where PySpark failed to initialize on systems using ARM64 architecture (such as Mac M1/M2/M3/M4/M5 chips) due to a hardcoded JAVA_HOME path in the Dockerfile.

Changes:

  • Updated Dockerfile to dynamically locate the OpenJDK path using dpkg --print-architecture instead of hardcoding amd64.
  • Ensured a consistent symlink at /usr/lib/jvm/default-java to point to the correct architecture-specific Java installation.

Why this is needed:
Without this change, the airflow standalone services and Jupyter notebooks fail to start PySpark sessions on Mac M-series machines because the Java gateway process cannot be found at the previous hardcoded path.

Verification:

  • Built the image using docker compose up --build.

  • Verified that the IPython startup scripts (01-spark-init.py) successfully create a Spark session on an ARM64 host.

  • Confirmed the %%sql magic is working correctly in Jupyter Lab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant