Sign in to follow this  

"Could not find or load main class" error

Recommended Posts


"Could not find or load main class" means one of two things:

  • You are running a Java application with a Java version that is older than what was used to compile it;
  • You're running the application with the wrong application (java instead of javaw, for example);

To fix #1:

  • Uninstall all versions of Java that you have installed.
  • Restart your computer so the uninstallation process can finish.
  • Download and install the latest Java.
  • Restart your computer to update your environment variables.

To fix #2:

  • Right-click the jar and select Open with > Choose default application
  • Click the "Browse" button and find "C:\Program Files\Java\".
  • You should see files named "jre" followed by some numbers. Open it.
  • Go into "bin"
  • Select javaw.exe
  • Hit OK

Share this post

Link to post

Sign in to follow this