How to run compiled java code !!!

i've written one very simple java code and compiled, but when i run it gives me error as java class not found.

i've written code as:

package com.example;

publicclass nav

{

publicstaticvoid main(String args[])

{

System.out.println("Hello World");

}

}

then compiled as:

javac -d f:/ nav.java

it creates a folder named as com/example and under that nav.class has been created.

But when i try to run this nav.class file it gives me as:

Exception in thread"main" java.lang.NoClassDefFoundError: nav (wrong name: com/

example/nav)

could anyone tell how to run any compiled java source code with package....

in advance thanks....

[1090 byte] By [Navneet_Singha] at [2007-11-26 16:04:08]
# 1
The fully qualified class name is com.example.nav. The top leveldirectory is your classpath, so you run your class like this:java -classpath f:/ com.example.navkind regards,Jos
JosAHa at 2007-7-8 22:26:03 > top of Java-index,Java Essentials,New To Java...
# 2
note: classnames should be uppercaseI also wouldn't recommend using a drive letterso it should be:java com.example.Nav
CarrieHunta at 2007-7-8 22:26:03 > top of Java-index,Java Essentials,New To Java...