Any java code I compile and try to execute from CMD line results in the error:
Error: Could not find or load main class
I have tried setting environment variables:
PATH=C:\Program Files\Java\jdk1.8.0_202\bin
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_202
and with and with out:
CLASSPATH=C:\Program Files\Java\jdk1.8.0_202\jre\lib or
CLASSPATH=C:\Program Files\Java\jdk1.8.0_202\jre\lib\rt.jar or
CLASSPATH=(directory of code)
The following is an example of a simple test prog that will not run:
/**
* Experiment with println() and print()
*/
public class HelloGoodbye
{
public static void main(String[] args)
{
System.out.println("My First Hello!");
System.out.println("Hello again!");
System.out.print("Hello finally!");
System.out.print("Goodbye!");
}
}
This produces: Error: Could not find or load main class