How to get java getRuntime().exec() to run a command-line program with arguments?

后端 未结 4 1742
一生所求
一生所求 2020-12-14 21:34

I\'ve been trying to write a java program that uses the Runtime.getRuntime().exec() method to use the command-line to run an instance of the program \"tesseract

4条回答
  •  太阳男子
    2020-12-14 22:12

    well tesseract is external command so you do not need to use it with cmd. Add tesseract to environment variables. Use direct command as :

    String[] commands = {"tesseract", imageFilePath, outputFilePath };
    

    Exist status 1 means Incorrect function. See process exit status

提交回复
热议问题