title: How can I compile code that uses a .jar file class with BlueJ?
body: <p>I am learning java with BlueJ, and recently I was given a .jar file called <code>Imagen.jar</code>. Apparently, what it does is return some pixel vectors depending on image file names given as parameters to it.</p>
  
  <p>Anyway, I am supposed to make a program that will use a class called <code>Imagen</code>. Apparently, such class is within the mentioned <code>.jar</code> file.</p>
  
  <p>Clearly, BlueJ won't compile if I'm using such class since I have not imported it or anything. But, I don't really know how to import such class in the first place.</p>
  
  <p>I was given the following example code:</p>
  
  <pre><code>import java.io.PrintWriter;
  
  public class Main {
     public static void main(String arg[ ]){
        if(arg.length &gt; 1){
           Imagen imagen = new Imagen(arg[0]);
           int [][] m = imagen.getMatriz();
           PrintWriter salida = null;
           try {
               salida = new PrintWriter(arg[1]);  
           }
           catch(Exception e){
              System.err.println(e);   
           }
           for(int [] fila : m ){
              for(int valor : fila){
                 System.out.print("\t"+valor);
                 salida.print("\t"+valor);
              }   
              salida.println("");
              System.out.println("");
           }
           if(salida!=null){
              salida.close();
           }
        }
        else {
           System.out.println("Uso: java -classpath .;Imagen.jar Main nombreArchivo.gif");  
        }
     }
  }
  </code></pre>
  
  <p>Which does not compile using BlueJ. However, as you can see, at the end it says that to use it, you have to type in the terminal:</p>
  
  <pre><code>java -classpath .;Imagen.jar Main myImageFile.gif
  </code></pre>
  
  <p>And I do it. But it keeps throwing me the same message.</p>
  
  <p>So I am stuck right now:</p>
  
  <ul>
  <li>Why is the terminal line I was told to use not working?</li>
  <li>How can I import the class that is contained within a .jar file?</li>
  </ul>