You can add following Dockerfile to JAVA docker image.
FROM openjdk:8
#Create a new app directory for my application files (Inside image file system)
RUN mkdir /app
#Set the directory for excuting future commands
WORKDIR /app
#Copy my application files from host machine into image file system
COPY target/docker-helloworld-1.0-SNAPSHOT.jar app.jar
#Run jar file
ENTRYPOINT ["java","-jar","app.jar"]