开发者

How do I compile a Java application that uses Apache Commons IO at the command line

开发者 https://www.devze.com 2022-12-23 04:39 出处:网络
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

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...

0

精彩评论

暂无评论...
验证码 换一张
取 消