Create runnable jar from command line
<p>In folder <code>~/code/</code> I have
<code>bin/ src/ lib/</code>
    A manifest.txt is created in ~/ with the content:</p>

<pre><code>Main-class: test.MyMainClass
Class-Path: lib/*.jar
</code></pre>

<p>Then in ~ I used command</p>

<p><code>jar cfm d.jar manifest.txt code/</code></p>

<p>then I run</p>

<p><code>java -jar d.jar</code></p>

<p>it says</p>

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