Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build on mac breaks due to JAVA_HOME error #159

Closed
OpHealer opened this issue May 8, 2023 · 2 comments
Closed

Docker build on mac breaks due to JAVA_HOME error #159

OpHealer opened this issue May 8, 2023 · 2 comments

Comments

@OpHealer
Copy link

OpHealer commented May 8, 2023

Docker build on mac will break and produce this error

12 0.159 ERROR: JAVA_HOME is set to an invalid directory: /usr/bin/java #12 0.159 #12 0.159 Please set the JAVA_HOME variable in your environment to match the #12 0.159 location of your Java installation. #12 0.159 #12 ERROR: executor failed running [/bin/sh -c mkdir -p ~/.android && touch ~/.android/repositories.cfg && echo y | sdkmanager "platform-tools" && echo y | sdkmanager "build-tools;$ANDROID_BUILD_TOOLS_VERSION" && mv ~/.android .android && chown -R 1300:1301 .android]: exit code: 1

I believe it is caused by setting JAVA_HOME to point to symlink target and not source, verified this by running ls -ll on /usr/lib/jvm

#7 [ 4/15] RUN ls -ll /usr/lib/jvm #7 sha256:d4488a56ef14b38ee2b0d99d1b62cf4f4c98dcd312d213312a38fd9e82050a48 #7 0.165 total 8 #7 0.165 lrwxrwxrwx 1 root root 21 Jan 20 09:07 java-1.11.0-openjdk-arm64 -> java-11-openjdk-arm64 #7 0.165 drwxr-xr-x 9 root root 4096 May 8 11:36 java-11-openjdk-arm64 #7 0.165 drwxr-xr-x 2 root root 4096 May 8 11:37 openjdk-11 #7 DONE 0.2s

Changing JAVA_HOME in Appium/Dockerfile fixed it for me
I used the symlink source:

Changed ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk-arm64 to ENV JAVA_HOME="/usr/lib/jvm/java-1.11.0-openjdk-arm64"

@budtmo
Copy link
Member

budtmo commented Jun 7, 2023

Hi @OpHealer ,

Thank you for raising the issue. Could you create a PR from your solution to the repo? I will approve your PR and merge it.

@budtmo
Copy link
Member

budtmo commented May 3, 2024

duplicated #162

@budtmo budtmo closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants