Note that there are some explanatory texts on larger screens.

plurals
  1. POExporting eclipse project to jar
    text
    copied!<p>I did check the already answeared questions which have almost the same topic as this question but none of the answeared onces were able to solve my problem.</p> <p>I have been searching now online for about 4 hours and tried soo many different things to solve my problem.. </p> <p>Im trying to make a Pong game in Java and now i wanted to export my project so i can send it to some friend so he can try it. </p> <p>Im using LWJGL for this project so i do have some jars added to the referenced libraries, And the LWJGL.jar has the windows natives added which is included in the projects lib folder. Here is an image of the project viewer:</p> <p><img src="https://i.stack.imgur.com/3vIGM.png" alt=""> Reason im posting this image is so you get an idea of that i have all the libraries inside the project aswell as the natives needed for the project to run.</p> <p>While reading about why the jar didnt work i also read that you need a Manifest.mf file so i created one and inside this manifest file i have the following text:</p> <pre><code>Manifest-Version: 1.0 Main-Class: jGame.Main Class-Path: lib/jars/asm-debug-all.jar lib/jars/jinput.jar lib/jars/lwjgl.jar lib/jars/izma.jar lib/jars/slick.jar </code></pre> <p>Also 2 empty lines underneath Class-Path since i heard u have to have that.</p> <p>This project runs fine aslong as i run it in eclipse but when i export the project with either runnable jar or jar wizard in eclipse it doesn't start when i double click the .jar file so i went into the cmd and used this command:</p> <pre><code>java.exe -jar JGame.jar </code></pre> <p>And the following message was shown:</p> <p><img src="https://i.stack.imgur.com/AfT03.png" alt=""></p> <p>I have checked atleast 10 times that i provided the correct path for the main class.. And i dont know what to do anymore. In the eclipse wizard i have been trying both to export runnable jar and exporting normal jar but none of the two is working. Also in the wizards i have selected to export a normal jar not runnable since when i choose runnable the libraries get messed up because the lib folder gets replaced.</p> <p>I tried opening the jar file as an archive and got the following: <img src="https://i.stack.imgur.com/eoAj3.png" alt=""></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