Skip to content

Conversation

@PavaraM
Copy link

@PavaraM PavaraM commented Jan 29, 2026

This PR fixes an issue where some JDK distributions (e.g. Azul JDK 8)
unpack with additional directory levels, causing the launcher to fail
locating bin/java / bin/javac.

Instead of assuming a fixed archive structure, the launcher now:

Locates the JDK by searching for bin/javac (ensuring a real JDK, not a JRE)

Handles macOS .jdk bundles via Contents/Home/bin

Normalizes the extracted JDK so JAVA_HOME always points to the cache root

This keeps existing behavior unchanged for standard Temurin layouts
while making JDK detection resilient across vendors.

Fixes #248.

- Use find command to locate bin directory at variable depths
- Add validation for javac executable
- Preserve macOS special handling
- Add error messages for invalid structures

Includes test script to verify logic works for:
- Standard single-level structure
- Azul 8 double-nested structure
- Triple-nested edge case

Fixes jeka-dev#248
Some JDK distributions (notably Azul JDK 8) unpack with additional
directory levels, causing the launcher to fail locating JAVA_HOME.

This change makes JDK detection more robust by:
- Locating the JDK via the presence of bin/javac instead of assuming a fixed layout
- Handling macOS .jdk bundles (Contents/Home/bin) explicitly
- Normalizing the extracted JDK so JAVA_HOME always points to the cache root

This preserves existing behavior for standard layouts while fixing
nested JDK structures.
@PavaraM PavaraM changed the title Fix nested JDK layouts (Azul JDK 8) Fix nested JDK layouts (Azul JDK 8) #248 Jan 30, 2026
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.

Fix downloading jdk AZUL 8 in Bash script

1 participant