views:

62

answers:

3

Hi all, 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 does not exist.

+1  A: 

try

javac my_package/my_program.java -cp commons-io.jar 
Mykola Golubyev
Thought I had it. It compiled with out error but when I checked the folder no class files were created. Any thoughts?
typoknig
@typoknig - my thought is that you would do well to read the javac(1) "manual page" relevant to your platform; see http://java.sun.com/javase/6/docs/technotes/guides/javac/index.html
Stephen C
Yes, that is basically the same info that javac -help gives me, but following that as I understand it right now is not getting the job done for me, thus the question. If my package was named "my_package" and my program was named "my_program" and all of my *.java files and my apacheCommonsIo.jar file were in a folder named "my_package" located directly on the (c:) drive what exactly do I need to type to type at the command line to make it all work?
typoknig
A: 

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.

Riduidel
A: 

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

typoknig