I'm using IntelliJ and I am trying to use the FileUtils.copyFile() method. When I use that method I get this error:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apach
e/commons/io/FileUtils
Here is the code that uses the copy file method:
import org.apache.commons.io.FileUtils;
...
try {
File destJAR = new File("c:/X-Dock/MP3Player.jar");
File playerJAR = new File(MP3Player); //"MP3Player" is a string that is defined earlier.
FileUtils.copyFile(playerJAR, destJAR);
}catch (IOException e){
e.printStackTrace();
}
I imported the Apache Commons JAR "commons-io-2.4" into the IntelliJ project by going to
File -> Project Structure -> Libraries -> Add -> Java -> "commons-io-2.4.jar"
Any help would be greatly appreciated.