# java.lang.NoClassDefFoundError

**URL:** <https://forum.universal-robots.com/t/java-lang-noclassdeffounderror/10833>\
**Category:** URCap Development\
**Tags:** pom-file, build-error\
**Created:** [December 15, 2020, 11:14am UTC](https://forum.universal-robots.com/t/java-lang-noclassdeffounderror/10833 "2020-12-15T11:14:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon47605637](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@anon47605637](https://forum.universal-robots.com/u/anon47605637)\
**Post date:** [December 15, 2020, 11:14am UTC](https://forum.universal-robots.com/t/java-lang-noclassdeffounderror/10833/1 "2020-12-15T11:14:53Z")

</div>

Hello

I am trying to implement functionality for OCR text recognition in URCap. I am using Tesseract ver. 3.4.8. I’ve added tess4j-3.4.8.jar file in resources folder and then in Project properties -\> Java Build Path -\> Libraries I’ve added it as external JAR.

In pom.xml file I’ve added:

\< dependency \>  
\< groupId \> net.sourceforge.tess4j\< /groupId \>  
\< artifactId \>tess4j \< /artifactId \>  
\< version \> 3.4.8 \< /versio n\>  
\< /dependency \>

and

\< Import-Package \>  
com.ur.urcap.api\*,  
sun.misc.\*;resolution:=optional,  
!net.sourceforge.tess4j,  
\*  
\< /Import-Package \>

When i deploy my URCap on usrsim and try to run it I get the following error:  
java.lang.NoClassDefFoundError: net/sourceforge/tess4j/Tesseract

If net.sourceforge.tess4j is not added in Import-Package or is added without ! when I deploy the UrCap on ursim, in Settings -\> System -\> URCaps my URCap is with yellow exclamation mark.

Can somebody tell me where I’m wrong. I am .NET developer and Java is new for me.

---

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [December 29, 2020, 12:39pm UTC](https://forum.universal-robots.com/t/java-lang-noclassdeffounderror/10833/2 "2020-12-29T12:39:33Z")

</div>

Hi @anon47605637,

Welcome to the UR community!

Please also add the `<Embed-Dependency>` tag to your pom.xml file as described here:

> [@Embedding dependencies in a URCap](https://forum.universal-robots.com/t/embedding-dependencies-in-a-urcap/498):
>
> If you need to embed a necessary bundle for your URCap plugin, please refer to the [Apache Felix Maven Bundle Plugin](http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html). The bundle must be “embedded” inside the .urcap file, which essentially is a .jar file. Please check your pom.xml file for the \<Embed-Dependency\> tag, and embed the bundle through here. You can check is the dependency is a success, by checking the .jar file after build for the referenced dependency. Besides from embedding the necessary classes, OSGi will also expect MANIFEST.m…

Best regards  
Ebbe
