How do I import libraries in my java program without using an IDE like Netbeans?
In Netbeans I do it this way:
You should put them on your classpath, like
java -classpath someJar.jar YourMainClass
And, of course, you can do the same for javac.
If you need to have more than one jar or directory on your classpath, you'll need to use your platform's default path separator. For example, on Windows,
java -classpath someJar.jar;myJar.jar YourMainClass
On a side note, you might find it easier to use an IDE to manage this sort of stuff. I've personally used just my slightly scriptable editor and have managed fine. But it's good to know how to do this stuff by command line.