check java version

Java
java --versionjava --version

Source

Also in Java: