Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>Could not find the main class: MyClass </code></pre> <p>The error seems actually related to your <code>MANIFEST</code> which:</p> <ul> <li>may not have a complete classpath <code>Class-Path</code>: see <a href="http://www.rgagnon.com/javadetails/java-0587.html" rel="nofollow noreferrer">this HowTo</a></li> </ul> <blockquote> <p>The best solution when you have a jar is to try to include the required jars into the manifest declaration.</p> </blockquote> <pre><code>Manifest-Version: 1.0 Class-Path: customer_client.jar mailer_client.jar signon_client.jar </code></pre> <ul> <li>or may not define adequately the MainClass within your 'my_jar.jar'. </li> </ul> <p>See <a href="http://www.rgagnon.com/javadetails/java-0532.html" rel="nofollow noreferrer">this HowTo</a>:</p> <pre><code>&lt;target name="jar" depends="compile"&gt; &lt;delete file="hello.jar"/&gt; &lt;delete file="MANIFEST.MF"/&gt; &lt;manifest file="MANIFEST.MF"&gt; &lt;attribute name="Built-By" value="${user.name}"/&gt; &lt;attribute name="Main-Class" value="howto.Hello"/&gt; &lt;/manifest&gt; &lt;jar destfile="hello.jar" basedir="." includes="**/*.class" manifest="MANIFEST.MF" /&gt; &lt;/target&gt; </code></pre> <p>the <code>&lt;attribute name="Main-Class" value="howto.Hello"/&gt;</code> needs to specify the full path (packages) of the <code>MainClass</code>, not just <code>MainClass</code>.</p> <p>If your main class is in the default package (the <a href="http://java.sun.com/docs/books/jls/second_edition/html/packages.doc.html#26639" rel="nofollow noreferrer">unnamed package</a>), I am not sure it can be referenced by the loader (see this <a href="https://stackoverflow.com/questions/859603/java-is-there-a-tool-to-make-code-in-a-3rd-party-jar-forward-compatible-1-4">SO question</a>)<br> So move your <code>JarRunner</code> into a package, and declare it appropriately in the <code>&lt;attribute name="Main-Class" value="myPackage.JarRunner"/&gt;</code> element.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload