I try create helloWorld application on hava and start it in docker on windows.
- I write application: - public class HelloWorld { public static void main(String[] args) { System.out.println("Start... "); System.out.println("Hello Pavel!"); } }
- I create Docker file: - FROM java:8 ADD HelloWorld.java . RUN javac HelloWorld.java CMD ["java", "HelloWorld"]
- Bouth files I put to - java-applicationfolder:- -java-application -HelloWorld.java -Dockerfile
- I try build it: 
Pavel\java-application>docker build -t java-application . Sending build context to Docker daemon 3.072kB Step 1/4 : FROM java:8 ---> d23bdf5b1b1b Step 2/4 : ADD HelloWorld.java . ---> Using cache ---> d4e0c540b57b Step 3/4 : RUN javac HelloWorld.java ---> Using cache ---> 5f5204f28710 Step 4/4 : CMD ["java", "HelloWorld"] ---> Using cache ---> 53ebab34502c Successfully built 53ebab34502c Successfully tagged java-application:latest SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
I show all images:
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
java-application    latest              53ebab34502c        2 minutes ago       643MB
hello-world         latest              4ab4c602aa5e        8 days ago          1.84kB
ubuntu              latest              cd6d8154f1e1        9 days ago          84.1MB
nginx               latest              06144b287844        10 days ago         109MB
java                8                   d23bdf5b1b1b        20 months ago       643MB
- I try start application: - C:\Pavel\java-application>docker run java-application Error: Could not find or load main class HelloWorld 
EDDIT
I change dockerfile:
FROM openjdk:8
ADD HelloPavel.java .
RUN javac HelloPavel.java
ENTRYPOINT ["java", "HelloPavel"]
I have
hello-pavel         latest              c817bd40d62c        25 seconds ago      624MB
I start:
C:\Pavel\hello-pavel>docker run hello-pavel:latest
Error: Could not find or load main class HelloPavel
 
    