ClassNotFoundException/NoDefFound on Runtime, but class imported works on it's own?
<p>I'm trying to import a jar that I created to my project in Eclipse. When trying any calls from the so-called jar, I get the following exception:</p>

<pre><code>Exception in thread "main" java.lang.NoClassDefFoundError
Caused by: java.lang.ClassNotFoundException
</code></pre>

<p>I believe this is caused due to the class being present on compile, but not being executed in runtime.</p>

<p>The problem is: When I run the jar on its own (without being imported), it works as intended, with all the functionalities. But I now need it to function as being part of a bigger jar, without changing the runtime classpath (didn't do that to the original project).</p>

<p>How can that be achieved?</p>

<p><strong>@Edit</strong></p>

<p>The class not being found or def not being found is ByteList, from the FastUtil library.
    Exception in thread "main" java.lang.NoClassDefFoundError: it/unimi/dsi/fastutil/bytes/ByteList</p>

<p>It's imported TO another Jar, let's call it MyJar.jar; MyJar.jar functions perfectly as a standalone jar, as the intention for it is to be a library, and it functions by itself.</p>

<p>The situation is: When I import MyJar.jar to another project, it won't work anymore, I can't use it's methods and classes inside the new project.</p>

<p>MyJar.jar can be run from the command prompt, with <code>java -jar MyJar.jar</code>, and it will print it's test-page to show that it's working.</p>

<p>The new project compiles, but when it's ran, I get the class not found exceptions regarding MyJar project.</p>