configuring classpath in java
<p>I am new to java..</p>

<p>I have an example structure as follows:</p>

<pre><code>/folder/foo.java /folder/bar.java /folder/foobar.java
</code></pre>

<p>Now I am trying to run foobar.java but I get the following exception</p>

<pre><code>Exception in thread "main" java.lang.ClassNotFoundException: /folder/foobar
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
</code></pre>

<p>Then I tried to configure it by doing </p>

<pre><code>java -classpath  .  foobar 
Exception in thread "main" java.lang.NoClassDefFoundError: foobar
Caused by: java.lang.ClassNotFoundException: foobar
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
</code></pre>

<p>Any clues?
Thanks</p>
