-
Notifications
You must be signed in to change notification settings - Fork 742
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
Java executable not found depending on container #678
Comments
Hello @abbasyadollahi, Thank you for creating this issue and we will look into it :) |
Having kind of the same issue here with my project. Mockito cannot find the java executable. I worked around it via pinning the ubuntu version to 24.04. With ubuntu-latest I get:
Please let me know if I confuse something here. |
Hi @abbasyadollahi , This issue can be resolved by adding an extra step in the job. Following are the steps that you need to add to make the job work. - To make the job run successfully, we need to install java in the container using the docker's apline package manager to make to get java executable detected. |
@abbasyadollahi my issue disappeared magically when using ubuntu-latest now. Maybe it's worth a try. |
Hi @abbasyadollahi , We are awaiting for your response on the issue. Please let us know if we can close this issue if there are no further queries. |
@srcimon @suyashgaonkar |
Hi @abbasyadollahi , the setup-java is responsible in dealing with functionalities and configurations related to Github Action runners and not the containers. The reason being java commands working fine on ubuntu:latest container and not in docker:cli is ubuntu:latest container has jdk installed by default, the case is not same with the docker:cli hence we would explicitly need to install jdk while working with docker containers. |
@suyashgaonkar
Seems there's something specifically wrong with the |
Hi @abbasyadollahi, The docker:cli is alpine linux based image which is built around MUSL whereas ubuntu:latest is GLIBC based image and works with setup-java seamlessly. docker:cli being a MUSL based image requires to go through a extra step i.e is to install a MUSL based open-jdk manually with the help of Alpine Package Keeper (apk). Let us know if you still need any assistance or we can close this issue ? |
Ok I see, so if I understood correctly, you're saying setup-java doesn't support installing a JDK on MUSL based systems (like alpine)? If that's the case, then we can go ahead and close this ticket, though it would definitely be a nice to have, or at least an indication of this pitfall in the action's README. |
Hi @abbasyadollahi, Thank you for your feedback. You understood correctly. We appreciate your understanding and agree that this feature would be beneficial to have. Additionally, please note that setup-java actions are available for environments that GitHub Actions hosted runners support. We will go ahead and close this issue. |
Description:
I have a simplified action which sets up Java inside of a container. Depending on the container used, I get an error because it fails to run the the installed Java executable, even though it seems to exist. The Java version doesn't seem to matter.
Task version:
v4
Platform:
Runner type:
Repro steps:
Here's a barebones example of the steps in the GitHub action, where
test-docker
fails andtest-ubuntu
works.Expected behavior:
I expect both jobs to successfully install the
java
executable (which they seem to do) and be able to execute it.Actual behavior:
The
test-docker
job seems to install thejava
library properly, but doesn't seem to be able to execute it. On the other hand, thetest-ubuntu
job installs thejava
library properly and is able to run thejava
executable as expected. In both cases, thejava
lib seems to exists on disk, but the job using thedocker:cli
image as its container can't find thejava
executable. Below is an excerpt of the output of theExecute Java
step of each job.test-docker
test-ubuntu
The text was updated successfully, but these errors were encountered: