Java - compile from command line - external jar
<p>I am using this library to compile a java program. I am using eclipse, but I also want to try and compile it from the command line (it will be executed through the command line). Its seems to be working on Eclipse.</p>

<p>I have tried this in the command line and it seems to be working:</p>

<pre><code>javac -cp ../lib/jxl.jar Main.java
</code></pre>

<p>but it gives me this:</p>

<pre><code>Main.java:5: cannot find symbol
symbol  : class Reader
location: class Main
    Reader excel_reader = new Reader();
    ^
Main.java:5: cannot find symbol
symbol  : class Reader
location: class Main
    Reader excel_reader = new Reader();
</code></pre>

<p>I just have 2 classes, Main ( that has only the main method ) and a Reader. Both files are under the src/ folder in eclipse workspace.</p>

<p>Reader class:</p>

<pre><code>import java.io.File;
import java.io.IOException;

import jxl.Cell;
import jxl.CellType;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;

public class Reader {
  private String inputFile;

  public void setInputFile(String inputFile) {
    this.inputFile = inputFile;
  }

  public void read() throws IOException  {
    File inputWorkbook = new File(inputFile);
    Workbook w;
    try {
      w = Workbook.getWorkbook(inputWorkbook);
      // Get the first sheet
      Sheet sheet = w.getSheet(0);
      // Loop over first 10 column and lines

      for (int j = 0; j &lt; sheet.getColumns(); j++) {
        for (int i = 0; i &lt; sheet.getRows(); i++) {
          Cell cell = sheet.getCell(j, i);
          CellType type = cell.getType();
          if (type == CellType.LABEL) {
            System.out.println("I got a label "
                + cell.getContents());
          }

          if (type == CellType.NUMBER) {
            System.out.println("I got a number "
                + cell.getContents());
          }

        }
      }
    } catch (BiffException e) {
      e.printStackTrace();
    }
  }

}
</code></pre>

<p>Main Class</p>

<pre><code>import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    Reader excel_reader = new Reader();
    excel_reader.setInputFile("Excel_Spreadsheets/Dictionary_Part2.xls");
    excel_reader.read();
  }
}
</code></pre>
