Package does not exist when compiling

1.5k views Asked by At

I´ve made a Java Project on Windows and now I want to use it under Linux. Since I am working with Files, I "need" the org.apache.commons.io.FilenameUtils package. Under Windows I am working with IntelliJ, so it manages everything for me. I am sharing the Directory of the Project via VirtualBox shared folder. When I try to compile the Main class I get

error: package org.apache.commons.io does not exist import org.apache.commons.io.FilenameUtils; ^

I already tried javac -classpath . Main.java but I just get the same Error. To be honest I am completely lost from this Point on, althought I already googled the Problem for a bit. I run Debian and Java JDK 8

1

There are 1 answers

0
M A On BEST ANSWER

You need to have the Commons IO Jar in the classpath when compiling, for example:

javac -cp .:path_to_commons_io_jar Main.java