Running java program in windows cmd. Passing string arg
<p>Hey, this is probably a simple question, but I am having trouble running my java program from command line. I have 3 java files that I compiled and now I have 3 class files in a directory. I want to run them and pass a string parameter to my main.</p>

<p>Code Sample:</p>

<pre><code>package dfa;
public class Main {

public static void main(String[] args) {

    DFA myDFA = new DFA();

    run(myDFA, args);
}

public static void run(DFA myDFA, String[] args)
{
    String test = args[0];
    if(myDFA.accept(test))
        System.out.println("yes");
    else
        System.out.println("no");
}
}
</code></pre>

<p>How I am running it:</p>

<pre><code>java -classpath . Main.class testString
</code></pre>

<p>Error:</p>

<pre>
Exception in thread "main" java.lang.NoClassDefFoundError: Main/class
Caused by: java.lang.ClassNotFoundException:Main.class
.
.
.
.
Could not find the main class: Main.class
</pre>

<p>New Error:</p>

<pre>
Exception in thread "main" java.lang.NoClassDefFoundError: dfa/class
Caused by: java.lang.ClassNotFoundException:dfa.class
....Could not find the main class: dfa.Main
</pre>
