Java Class Not Found Exception / Could Not Find Class

Class Not Found

Could not find or load main class

You compiled your Java HelloWorld.java and then you are facing an error? Most likely you added the .class extension when the running the programm:

$ java HelloWorld.class
Error: Could not find or load main class HelloWorld.class

You were running the .class file. Try again:

$ java HelloWorld
Hello, World

Deal with ClassNotFound Exception

If you encounter a class not found exception while working with Oracle WebLogic server I recommend my posting about the Classloader Analysis Tool.

Trackbacks

  1. […] Analysis Tool (CAT) that can be helpful for weird behaviour or getting a better insight about ClassNotFound Exceptions. I did it a while ago and it almost got lost. It all applies to Java Cloud Service (JCS) […]

Speak Your Mind

*