I made an application in NetBeans and I used the Apache Commons IO jar file. The application works fine in NetBeans, but I want to be able to compile it from the command line. The Apache Commons IO jar is with my *.java files but I get a commpiler error that says package org.apache.commons.io do开发者_开发技巧es not exist.
try
javac my_package/my_program.java -cp commons-io.jar
Usually, Netbeans projects rely upon an ant file. As a consequence, you can compile on command line by locating this ant file, and calling its correct target.
Take a look at this forum message.
I gave up on this and just used BufferedWriter and FileWriter instead. Was much easier and worked great. Still don't know why Apache Commons IO wouldn't work for me...
精彩评论