sounds like a misunderstanding. By default, Netbeans uses ant to build projects. Ant is a CLI build tool. So, most any Netbeans project will easily compile and build as a JAR from the CLI. Simply run ant -p build.xml from in the project directory. You should see options to build. As far as I can recall, ant jar will build and distribute most any SE project out of the box.
That's building from the CLI.
Probably the instructions were (back in 2010) to use javac directly.
As Jigar said, you have a classpath problem. Your classpath problem is unrelated to building the JAR from the Netbeans GUI or from the CLI.