我有一個類ExcelReadWrite運行良好,當我通過eclipse.But運行時,當我嘗試從命令行運行它時,需要設置相關類的類路徑。錯誤:無法找到或加載主類ExcelReadWrite
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;
設置類路徑後,它編譯成功,但是當我執行我的類,然後發生此異常。
Error: Could not find or load main class ExcelReadWrite
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");
}
}
我用下面的命令來編譯和執行我的課
E:\excelTest>javac ExcelReadWrite.java
E:\excelTest>java ExcelReadWrite
Error: Could not find or load main class ExcelReadWrite
如何從運行命令行。顯示命令 – Jens