In Java, when you sometimes run the JVM from the command line using the javaJava interpreter executable and are trying to start a program from a class file with public static void mainpublic static void main (PSVM), you might run into the below error even though the classpath parameter to the JVM is accurate and the class file is present on the classpath:
Error: main class not found or loaded
Error: main class not found or loaded
This happens if the class file with PSVM could not be loaded. One possible reason for that is that the class may be implementing an interface or extending another class that is not on the classpath. Normally if a class is not on the classpath, the error thrown indicates as such. But, if the class in use is extended or implemented, javaJava is unable to load the class itself.
Reference: https://www.computingnotes.net/java/error-main-class-not-found-or-loaded/