Java: 'Error: Could not find or load main class'
@devsingh05▲ 10 net votes
The class name or classpath is wrong. Run from the directory that contains the package folders, using the fully qualified name (java com.example.App, not java App.java from inside the package folder), and include dependencies with -cp. With Maven or Gradle, run through the build tool (mvn exec:java, gradle run) or build a runnable jar with the main class set in the manifest.