title: Using a class from a .jar file
body: <p>I am trying to use a class <code>FileUtils.class</code> from a <code>commons-io-2.4.jar</code> file. The code is as follows:-</p>
  
  <pre><code>package Lynda.Essential_training;
  import java.io.*;
  //import Lynda.Essential_training.org.apache.commons.io.*;
  
  public class fileHandlingCommons
  {
      public static void main(String[] args) throws Exception
      {
          File f1 = new File("/home/kusur/java_programs/source.txt");
          File f2 = new File("target2.txt");
  
          FileUtils.copyFile(f1,f2);
      }
  }
  </code></pre>
  
  <p>When I compile this program, with the command:- </p>
  
  <pre><code>javac -cp /usr/sys/java_programs/Lynda/Essential_training/Commons-io-2.4.jar Lynda/Essential_training/fileHandlingCommons.java
  </code></pre>
  
  <p>I get the following error:-</p>
  
  <pre><code>Lynda/Essential_training/fileHandlingCommons.java:12: error: cannot find symbol
          FileUtils.copyFile(f1,f2);
          ^
    symbol:   variable FileUtils
    location: class fileHandlingCommons
  </code></pre>
  
  <p>I am getting the same error when I am extracting all the files from the <code>.jar</code> folder and then compiling the program (in which case, the commented import statement in the program is used).</p>
  
  <p>Can you please help?</p>