0
我在Intellij Idea中創建項目,從maven添加tess4j 2.0,編寫測試應用程序。當我開始調試所有工作正常。當我點擊「構建工件」並啓動jar文件時,我沒有任何結果,沒有錯誤,沒有任何結果。用tess4j構建jar
public class MainApp {
static String fileName = "C:\\Users\\Alex\\Google Drive\\TW\\LIB\\Tess4J\\eurotext.png";
public static void main(String[] args) {
try {
System.setOut(new PrintStream(new File("output-file.txt")));
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("Start");
ITesseract instance = new Tesseract1(); // JNA Direct Mapping
try {
String result = instance.doOCR(new File(fileName));
System.out.println(result);
} catch (TesseractException e) {
System.out.println("Error");
System.out.println(e.getMessage());
e.printStackTrace();
}
System.out.println("End");
}
}
輸出調試啓動
時(快速)[棕色] {}狐跳!
在$ 43,456.78#90狗
&鴨/鵝,作爲電子郵件的12.5%.........
末
輸出時推出罐子
開始
沒有「錯誤」,沒有「結束」。怎麼可能?