Java using "-cp" and "-jar" together
<p>Folks,</p>

<p>Earlier, I had just one jar file and the manifest was set up such that I can simply run my program as:</p>

<pre><code> java -jar MyApp.jar
</code></pre>

<p>Now, I have separated my functionality into two jar files - MyCore.jar and MyApp.jar.</p>

<p>The following command works:</p>

<pre><code>java -cp "*" com.mycompany.mypackage.App
</code></pre>

<p>But I cannot get the following to work</p>

<pre><code>java -cp "*" -jar MyApp.jar
</code></pre>

<p>I get a ClassNotFoundException. </p>

<p>I prefer using "-jar" switch. Is there a way to make it work?</p>

<p>Thank you in advance for your help.</p>

<p>Regards,<br />
Peter</p>
