Compiling java program from command line passing args
<p>I wrote a simple java program</p>

<pre><code>package abc.def.ghi 
public class Foobar{


   public String printS(String s){
     System.Out.println(s);

 public static void main(String [] args){
   String s = args[0];
   Foobar foobar = new Foobar();
    foobar.printS(s);
}
</code></pre>

<p>Now I did javac Foobar.java</p>

<p>It created a class file</p>

<p>and then I did </p>

<pre><code>java Foobar
</code></pre>

<p>Didnt worked</p>

<pre><code> java Foobar hi //args
</code></pre>

<p>Didnt worked</p>

<p>java -cp . abc.def.ghi.Main</p>

<p>DIdnt worked.</p>

<p>Error I am getting is:</p>

<pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: abc/def/ghi/Main
Caused by: java.lang.ClassNotFoundException: com.intel.hadoop.graphbuilder.conf.Main
    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)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: com.intel.hadoop.graphbuilder.conf.Main.  Program will exit.
</code></pre>
