It depends on whether it has been packaged into a .jar file or is a .class file.
Your class is called hello.HelloWorld
If it's in a file called c:\work\hello\HelloWorld.class, you need to add the root directory to the class path.
On the other hand, if it's in a c:\work\hello.jar file, you add the jar file to the class path.
After that's it's the same.