I want to create a docker with java and test it, however I get an error
This is the docker file
FROM openjdk:8-jdk-slim
…
COPY Simple.java /project/
WORKDIR /project
CMD ["java" ,”--version”]
I try to run the file Simple.java
class Simple{
public static void main(String args[]){
System.out.println("Hello Java");
}
}
when I run the following command:
docker run mydocker javac Simple.java
I get the error:
Simple.java:1: error: error while writing Simple: Simple.class (Permission denied)
class Simple{
^
1 error
How could I test a simple java program and see that it works?
public class Simple.