title: Error: Could not find or load main class ExcelReadWrite
body: <p>I have a class ExcelReadWrite that runs fine when I run it through eclipse.But when I try to run it from command line I need to set classpath of dependent classes.</p>
  
  <pre><code>set CLASSPATH=C:\Users\NICSI\.m2\repository\org\apache\poi\poi-ooxml\3.11\poi-ooxml-3.11.jar;C:\Users\NICSI\.m2\repository\org\apache\poi\poi\3.11\poi-3.11.jar;
  </code></pre>
  
  <p>After setting class path it compiles successfully but when I execute my class then this exception occurs.</p>
  
  <blockquote>
    <p>Error: Could not find or load main class ExcelReadWrite</p>
  </blockquote>
  
  <pre><code> public class ExcelReadWrite {
  
  public static void main(String[] args) {
      String inputFile=args[0];
      String outputFile=args[1];
      System.out.println("inputFile 0   "+inputFile);
      System.out.println("outputFile 0   "+outputFile);
      transformExcelFile(inputFile,outputFile);
      //transformExcelFile("E:\\excel\\inputFile.xlsx","E:\\excel\\outputFile.xlsx");
      }
      }
  </code></pre>
  
  <p>I use following command to compile and execute my class</p>
  
  <pre><code>E:\excelTest&gt;javac ExcelReadWrite.java
  
  E:\excelTest&gt;java ExcelReadWrite
  Error: Could not find or load main class ExcelReadWrite
  </code></pre>