Fedora 31

馋奶兔 提交于 2020-02-28 11:21:07

今日捣鼓OCR引擎Tesseracat,发现中文识别错误率很高,所以想自己训练数据,参考文章需要用到jTessBoxEditor。下载后发现用自带的openjdk无法正常运行jar文件。出现错误:

Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException
    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
    at java.awt.Window.<init>(Window.java:536)
    at java.awt.Frame.<init>(Frame.java:420)
    at java.awt.Frame.<init>(Frame.java:385)
    at javax.swing.JFrame.<init>(JFrame.java:189)
    at net.sourceforge.tessboxeditor.Gui.<init>(Unknown Source)
    at net.sourceforge.tessboxeditor.GuiWithMRU.<init>(Unknown Source)
    at net.sourceforge.tessboxeditor.GuiWithEdit.<init>(Unknown Source)
    at net.sourceforge.tessboxeditor.GuiWithSpinner.<init>(Unknown Source)
    at net.sourceforge.tessboxeditor.GuiWithFont.<init>(Unknown Source)
    at net.sourceforge.tessboxeditor.GuiWithLaF.<init>(Unknown Source)
    at net.sourceforge.tessboxeditor.GuiWithTools.<init>(Unknown Source)
    at net.sourceforge.tessboxeditor.GuiWithGenerator.<init>(Unknown Source)
    at net.sourceforge.tessboxeditor.GuiWithTrainer.<init>(Unknown Source)
    at net.sourceforge.tessboxeditor.GuiWithValidator.<init>(Unknown Source)
    at net.sourceforge.tessboxeditor.GuiWithValidator$1.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

所以特地安装Oracle的JDK,又遇到问题:

sudo dnf install  jdk-8u241-linux-x64.rpm

问题: conflicting requests
  - nothing provides /bin/basename needed by jdk-11.0.6-2000:11.0.6-ga.x86_64
  - nothing provides /bin/cp needed by jdk-11.0.6-2000:11.0.6-ga.x86_64
  - nothing provides /bin/ls needed by jdk-11.0.6-2000:11.0.6-ga.x86_64
  - nothing provides /bin/mkdir needed by jdk-11.0.6-2000:11.0.6-ga.x86_64
  - nothing provides /bin/mv needed by jdk-11.0.6-2000:11.0.6-ga.x86_64
  - nothing provides /bin/pwd needed by jdk-11.0.6-2000:11.0.6-ga.x86_64
  - nothing provides /bin/sort needed by jdk-11.0.6-2000:11.0.6-ga.x86_64
(try to add '--skip-broken' to skip uninstallable packages) 

 正确步骤:

# cd jdk path
sudo rpm -Uvh jdk-8u241-linux-x64.rpm
sudo alternatives --config java
# cd jar path
sudo java -Xms128m -Xmx1024m -jar jTessBoxEditor.jar

JDK软件包下载:

链接: https://pan.baidu.com/s/1_H0TolU68wZGhda5SnqMbQ 提取码: 66ai 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!