I have a simple program in java which is run inside docker container.
I used Eclipse On windows - But I created the linux containers (with windwos docker desktop)
I used Powershell to start container The image is successfully created
I saw this thread but it didnt help me c++ program with docker. I have an error using the solution in that answer.
PS E:\Java\Test> docker run -v E:\Java\Test:\tt img \tt\in.txt
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: "\\tt\\in.txt": executable file not found in $PATH": unknown.
Dockerfile
FROM java:8
COPY hello.jar app.jar
CMD ["java", "-jar", "app.jar", "pkg.hello"]
public static void main(String[] args) throws Exception {
String fileName ="E:\\Java\\Test\\in.txt";
List<String> lines = Collections.emptyList();
lines = Files.readAllLines(Paths.get(fileName), StandardCharsets.UTF_8);
Iterator<String> itr = lines.iterator();
while (itr.hasNext())
System.out.println(itr.next());
}
Any ideas, thanks