Error opening data file ./eng.traineddata - java

I was going to read text from a PNG file, I used this code but I got this error, I'm using Ubuntu 18.04.
GIT - https://github.com/csanuragjain/extra/tree/master/ReadFromImages
Error opening data file ./eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fdc520d3c27, pid=19781, tid=0x00007fdcae2c5700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_271-b09) (build 1.8.0_271-b09)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.271-b09 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libtesseract.so.4+0xa1c27] tesseract::Tesseract::recog_all_words(PAGE_RES*, ETEXT_DESC*, TBOX const*, char const*, int)+0x437
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/bhanuka/Documents/CodeByB/Repos/imagereader/hs_err_pid19781.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

Finally, I found the solution,
I get the tesseract package
sudo apt-get install tesseract-ocr-eng
and added below lines to my Java code
Tesseract tesseract = new Tesseract();
tesseract.setDatapath("/usr/share/tesseract-ocr/4.00/tessdata");

Related

I get java core dumped error while updating android studio

I want to update Android-Studio, and I've downloaded the .jar file using firefox but have a problem.
I used this link and this to update it, but this error occures:
$ java -classpath Downloads/AI-181.5540.7.32.5056338-183.6156.11.34.5522156-patch-unix.jar com.intellij.updater.Runner install /home/user/Andriod/android-studio
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f0368d74009, pid=13991, tid=13992
#
# JRE version: OpenJDK Runtime Environment (9.0) (build 9-internal+0-2016-04-14-195246.buildd.src)
# Java VM: OpenJDK 64-Bit Server VM (9-internal+0-2016-04-14-195246.buildd.src, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C [libjava.so+0x1d009] JNU_GetEnv+0x19
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /home/user/core.13991)
#
# An error report file with more information is saved as:
# /home/user/hs_err_pid13991.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
[1] 13991 abort (core dumped) java -classpath com.intellij.updater.Runner install
/home/user/Andriod/android-studio is my android-studio installation path.
What should I do?

j2objc Error in Translate to Objective C

there is Android Source I Need to translate to Objective C
but it shows error :
java -Xbootclasspath:$J2OBJC_HOME/lib/jre_emul.jar -jar $J2OBJC_HOME/lib/j2objc.jar j2objcc
Invalid layout of java.lang.String at value
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (javaClasses.cpp:127), pid=575, tid=4867
# fatal error: Invalid layout of preloaded class
#
# JRE version: (8.0_51-b16) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode bsd-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/emaar/AndroidStudioProjects/TestBuild/app/src/main/java/com/emaar/app/testbuild/hs_err_pid575.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Abort trap: 6
any things set (JDK 8, Maven, SDK, Android Studio, Gradle, J2OBJC, ...)
how to solve it ?
"j2objcc" is not a Java source file. If you run your command without it, the valid usage and flags for j2objc will be displayed.

After update linux to version 4.2, Java write "Failed to write core dump"?

I work on one programm, that need to java 7. But when I update archlinux to 4.2 (from 4.1) ,when I start the programm, java write me:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fdf76d41be0, pid=3512, tid=140597796308736
#
# JRE version: Java(TM) SE Runtime Environment (7.0_79-b15) (build 1.7.0_79-b15)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.79-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C 0x00007fdf76d41be0
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/nozdrin/workspace/rvec/server/bin/hs_err_pid3512.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Java not update!! What happend with java and what do I need?
EDIT:
I found, when start the programm, he added keys -J-XX:PermSize=200m \
-J-XX:MaxPermSize=256m. When I delete this keys, java return another error:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f164f6b0be0, pid=5145, tid=139733914535680
#
# JRE version: Java(TM) SE Runtime Environment (7.0_79-b15) (build 1.7.0_79-b15)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.79-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C 0x00007f164f6b0be0
#
# Core dump written. Default location: /home/nozdrin/workspace/rvec/server/bin/core or core.5145
#
# An error report file with more information is saved as:
# /home/nozdrin/workspace/rvec/server/bin/hs_err_pid5145.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
This errors appeared when I update linux. I tried return old linux 4.1, but error still.
File hs_err_pid5145.log - is link on Google Drive.
Problem solved when I update to 4.4 kernel!
Thank all!

Unable to launch Carrot2 workbench in Ubuntu 14.04

When I tried to launch carrot2-workbench 64-bit linux executable in Ubuntu 14.04, I am getting an error as
2015-01-29 17:33:40,436 INFO org.carrot2.workbench.core.WorkbenchCorePlugin: Changed instanceLocation to: file:/home/administrator/Downloads/carrot2-workbench-3.9.4/workspace/
2015-01-29 17:33:40,871 INFO org.carrot2.util.xslt.TemplatesPool: XSLT transformer factory: com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fbd91d622a1, pid=8214, tid=140454572275456
#
# JRE version: Java(TM) SE Runtime Environment (8.0_31-b13) (build 1.8.0_31-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.31-b07 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libsoup-2.4.so.1+0x6c2a1] soup_session_feature_detach+0x11
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/administrator/Downloads/carrot2-workbench-3.9.4/hs_err_pid8214.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
What might be the problem?
Unfortunately it's a bug in underlying libraries. There is no known workaround as of yet -- keep an eye on this issue:
http://issues.carrot2.org/browse/CARROT-1058
In the meantime I'm afraid your options are limited to running Wb in a virtual machine with an older Ubuntu.

Ubuntu Linux -- JVM has stopped

#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f0c7e9fb100, pid=10645, tid=139691734513408
#
# JRE version: Java(TM) SE Runtime Environment (7.0_40-b43) (build 1.7.0_40-b43)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.0-b56 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libxcb-glx.so.0+0xb100] xcb_glx_query_server_string_string_length+0x0
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/LittleChild/workspace/jfx_practice/hs_err_pid10645.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
I get this when I try to run my JavaFX program on 64bit Ubuntu 12.04.
Can someone tell me what it is ?
There seems to be no answer to this on SO, I did check a similar question

Categories