I have a Java project that I’m writing in VS Code without Java extension and I need to run it on Docker.
I wrote a Dockerfile
and ran on Docker but it returns me an error:
*------
> [3/4] RUN javac CalculatorTest.java:
#6 0.436 /bin/sh: 1: javac: not found
------
executor failed running [/bin/sh -c javac CalculatorTest.java]: exit code: 127
This is my Dockerfile
:
FROM openjdk:11-jre-slim
WORKDIR /app
RUN javac CalculatorTest.java
COPY . .
CMD ["java","CalculatorTest"]
New contributor
Shira Hanuna is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2