With the Java SDK properly installed and configured, you should be able to go to a command prompt and type
java
to invoke the Java interpreter. If you get an error then something is not set up properly.
Check your
PATH
setting and try again. Most users in a Windows environment do not have their
CLASSPATH
set, and this is how their
PATH
looks:
PATH=C:\Program Files\Java\jdk-11.0.8; C:\Program Files\Java\jdk-11.0.8\bin
Type the command line prompt
java -version
to confirm that you have set everything up right and are using the latest version of Java.
If you want to have Java working on your Windows or Mac machine, you need to download the Java SDK.
It is available from Oracle at the following URL as of June 2018.
Download JDK from Oracle
The Oracle website contains specific instructions for installing the JDK followed by the installation of the JRE.
After these 2 components have been installed, you need to set the paths so that you are able to compile Java code on your machine.