Issue with copy JRE into docker and run java command

I am copying the working version of the JRE directory into docker and trying to run /JRE/bin/java.
But it throws java:command not found error. I am doing the same in a linux VM . Just copying the JRE folder and executing java command which works fine in VM. I don’t want to download JRE from anywhere.
Want this specific JRE bundled.How to resolve this.

Source: StackOverflow