Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Okay, I will walk you through the process I went through to analyse the issue:</p> <ul> <li>I took you jar and tried to run it via <code>java -jar pms.jar</code>. Indeed, that failed with the above mentioned error messages.</li> <li>I created a quick test class in your package that simply prints a message to system.out and put it in the jar file in the folder <code>net.pms</code>.</li> <li>I manually changed the <code>Main-Class</code> attribute in the Manifest to call that class (thus: <code>net.pms.Test</code>).</li> <li>I re-ran <code>java -jar pms.jar</code> and got the same error messages.</li> <li>I deleted all additional folders from the root of the jar and re-ran <code>java -jar pms.jar</code>. It yielded the same error messages.</li> <li>I deleted all the additional folders from <code>META-INF</code> and re-ran <code>java -jar pms.jar</code>. It still yielded the same error messages.</li> <li>I deleted all additional files from <code>META-INF</code> and re-ran <code>java -jar pms.jar</code>. The application worked fine.</li> <li>I started with a fresh copy of the jar, deleted only all additional files from <code>META-INF</code> and re-ran <code>java -jar pms.jar</code>. The application worked fine.</li> <li>I started with a fresh copy of the jar and one by one, I deleted the additional files from <code>META-INF</code>, re-running <code>java -jar pms.jar</code> as I went along. This gave me the following results:</li> </ul> <p>If your <code>META-INF</code> directory contains either one of the files <code>NB_IDE.DSA</code> or <code>NB_IDE.SF</code>, the main class of your application cannot be found by Java. It appears that the information in those files somehow influences the location mechanism of the classloader.</p> <p>I had a look at the files and it seems that it is some Netbeans specific information file. <a href="https://www.google.com/search?ie=UTF-8&amp;q=nb_ide.sf%20nb_ide.dsa" rel="nofollow">Google</a> did not really give me any results on this, neither did my network of colleagues have any clues on it. At this point, I would usually ask StackOverflow for help, but seeing that the files only concern Netbeans dependency information, I assume that the files are only used in your IDE. Also, since this is information that is needed at build time, but not at runtime, I assume that it is safe to remove the files from your final release jar. </p> <p>All you have to do now is exclude the files from the final build through your <code>build.xml</code>. I'll leave this up to you, as there is plenty of documentation on Ant on the internet. :)</p> <p><em>Now, why did I go through this in so much detail?</em><br/> Well, this is the typical process that I follow if I am facing a problem like this. First, I exclude all interfering parameters to pinpoint the problem. Then, I analyze the result - potentially using the internet to clarify points that I am not familiar with - to not resolve the symptoms but the cause. Then I eliminate the cause.</p> <p>Personally, I think that this process is a great tool in every developers toolbox to quickly resolve issues like the one you were facing. I hope that you can re-use it sometime in the future and don't have to wait days and days for my lazy-ass to finally have a look at it. :)</p> <p>Good luck with your software!</p>
 

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