You do not need to set any environment variables to be able to run Java programs.
You can add the
bin directory of the Java Runtime Environment (JRE) or Java Development Kit (JDK) to the PATH if you want - this is only for convenience, so that you don't have to type the whole path every time.
You do not need to set CLASSPATH. If you need the JRE to look for classes in other places than the directory from where you start your program, then you can set the classpath on the command line with the "-cp" (or "-classpath") option.
The variable JAVA_HOME is not used at all by the JRE or JDK. Some programs use this to find your Java installation (Apache
Tomcat for example), but Java itself does not need it.