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

which: command not found #199

Closed
bwcxyk opened this issue Mar 26, 2024 · 7 comments · Fixed by #202
Closed

which: command not found #199

bwcxyk opened this issue Mar 26, 2024 · 7 comments · Fixed by #202

Comments

@bwcxyk
Copy link

bwcxyk commented Mar 26, 2024

jetty.sh run
/usr/local/jetty/bin/jetty.sh: line 368: which: command not found

@joakime
Copy link
Contributor

joakime commented Mar 26, 2024

what is the image ID that you used to cause this error?
You can share your Dockerfile

@bwcxyk
Copy link
Author

bwcxyk commented Mar 26, 2024

what is the image ID that you used to cause this error? You can share your Dockerfile

jetty:9.4-jdk8-amazoncorretto

sh-4.2$ jetty.sh run
/usr/local/jetty/bin/jetty.sh: line 368: which: command not found
Cannot find a Java JDK. Please set either set JAVA or put java (>=1.5) in your PATH.

@joakime
Copy link
Contributor

joakime commented Mar 26, 2024

Note: Jetty 9, Jetty 10, and Jetty 11 are all now at End of Community Support.

See:

You should be using Jetty 12.
Since you have old webapps, you can use the ee8 environment in Jetty 12 to use the old javax.servlet namespace.

@lachlan-roberts
Copy link
Contributor

The image amazoncorretto:8 or even amazoncorretto:21 doesn't have the which command installed.

So I think this has little to do with Jetty version and just the fact that amazoncorreto is being used.

@bwcxyk You can install which yourself by adding this to your Dockerfile:

USER root
RUN yum install which -y
USER jetty

@lachlan-roberts
Copy link
Contributor

@joakime you think it is worth adding this by default to our AmazonCorretto Dockerfiles?

There is also a warning we have in place to discourage the use of jetty.sh:

********************************************************************
WARNING: Use of jetty.sh from this image is deprecated and may
 be removed at some point in the future.

 See the documentation for guidance on extending this image:
 https://github.com/docker-library/docs/tree/master/jetty
********************************************************************

@bwcxyk
Copy link
Author

bwcxyk commented Apr 9, 2024

USER root
RUN yum install which -y
USER jetty

I'm using the

@bwcxyk
Copy link
Author

bwcxyk commented Apr 10, 2024

Use

java -jar /usr/local/jetty/start.jar

@bwcxyk bwcxyk closed this as completed Apr 10, 2024
lachlan-roberts added a commit that referenced this issue Apr 11, 2024
lachlan-roberts added a commit that referenced this issue Apr 16, 2024
Issue #199 - install which for AmazonCorretto to allow use of Jetty.sh
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 a pull request may close this issue.

3 participants