I am trying to automate a Numeric Captcha using Tesseract OCR in Mac OS (Monterey). But I am facing below error.
java.lang.UnsatisfiedLinkError: Unable to load library 'tesseract': Native library (darwin/libtesseract.dylib) not found in resource path ([file:/Users/xyz/Katalon%20Studio/TestProject/bin/keyword/, file:/Users/xyz/Katalon%20Studio/TestProject/Keywords/, file:/Users/xyz/Katalon%20Studio/TestProject/bin/listener/,....])
Tesseract instance = new Tesseract();
instance.setDatapath(RunConfiguration.getProjectDir() + "/tessdata");
String imagePath = RunConfiguration.getProjectDir() + "/Captcha.png
String captcha = instance.doOCR(new File(imagePath));
The same code is working fine on my Mac in Intellij and in windows OS. Issue occurs only in Katalon studio in Mac. Can anyone please help me to solve this.
Thanks for using the Katalon Studio. Hope you are doing great.
Could you please send me you application in Test so that I can give it a try.
You will have to add “Testeract” into Katalon Library management first before using
I found a thread titled " Unable to load library ‘tesseract’: Native library (darwin/libtesseract.dylib)"
Have you installed Tesseract on Mac?
Hi @mohit.kumar ,
Thanks for your response.
Yeah, I have added all the required JAR files of Tesseract in Katalon Library management. But still facing the same error.
I have added the Test project for your reference. Tesseract Jar files are added separately. Kindly import these Jar files into Katalon.
DemoProject.zip (22.4 MB)
jar_files (1).zip (17.3 MB)
Hi @kazurayam ,
Yes, I have installed Tesseract on my Mac.
I have referred java - Tess4j unsatisfied link error on mac OS X - Stack Overflow and I have added the darwin/libtesseract.dylib file into the Maven repo. After adding this, Tesseract OCR is working fine in Intellij. But still I am facing the UnsatisfiedLinkError error in Katalon.
I do not understand what you mean “into the Maven repo”. Do you mean “into under the $HOME/.m2 folder”?
I guess you project in IntelliJ is configured to refer to the Maven local repository, so your code works.
However, Katalon Studio does not understand Maven at all.
Katalon assumes that every external resourses to be located under the Drivers folder manually by you.
Perhaps it is the reason why your code does not work in Katalon Studio.
Thanks for your information @kazurayam . I meant the Maven local repository.
I added the
libtesseract.dylib file under the Katalon project Drivers folder manually. Now I am facing
java.lang.UnsatisfiedLinkError: Unable to load library 'tesseract': Can't obtain InputStream for darwin/libtesseract.dylib error .
You should raise an official support request to the Katalon developer team.
If you are a paying customer, you can raise a support request at
If you are not a paying customer, what to do? ---- ask @vu.tran to address this. He might do something for you.
Thank you @kazurayam for letting me know. I already asked our product team to help. @mohit.kumar will investigate more details that @hemalatha.mani provided and we will assist shortly. Thanks for your continued support.
Hi @vu.tran ,
Please let me know if there is any possible fix for this issue.
Hi @hemalatha.mani for your follow-up. @mohit.kumar has tried to reproduce the issue but no luck so far. We have escalated this to our Product team for more information. We’ll update you once we have some progress. Best.