0

I use JCreator. After checking the internet and other posts on this website, I created a jar file using JCreator and opened it using WinRAR. After entering the MANIFEST.MF, I typed "Main-Class: " and specified which class my main method was in. Next, I saved it and attempted to run the .jar file, but to no avail. Absolutely NOTHING happened. Can someone explain to me what occurred and how I should create the jar file? The file should open the command prompt of the computer.

Oniontan
  • 19
  • 3
  • http://stackoverflow.com/questions/147181/how-can-i-convert-my-java-program-to-an-exe-file This answer contains info on how to create executable jar files that can be run using a double-click. This should help. – Marcus Talbot Mar 17 '15 at 13:13
  • 1
    @user3046986 What does that have to do with this question? He is not talking about an exe. Just a jar with a main - class – tom Mar 17 '15 at 13:14
  • I personally suggest Eclipse. It would be very simple for you to just export your project as a runnable JAR. – Malik Brahimi Mar 17 '15 at 13:16
  • when you opened jar file via WinRar it unpacked jar to the temp folder. So you have edited and saved manifest in a temp folder, not in the jar file. Unpack jar file contents to the folder you have created, then modify manifest and compose jar file via `jar` utility which can be found in `your_java_sdk/bin` folder. –  Mar 17 '15 at 13:16
  • did you add all resources and directorys (eg. if u read a file out of it) – Zorian Mar 17 '15 at 13:18
  • To debug and get more information about why your JAR won't start, you can run `java -jar nameOfJarFile.jar` from command-line. That will tell you what goes wrong when it fails to start. – Chronio Mar 17 '15 at 13:24
  • i tried what @Chronio said, it worked! Now I'm very confused. Isn't the jar file supposed to run upon double click????? or is it because there's a file in a file(directory in a directory)??? – Oniontan Mar 18 '15 at 13:53

0 Answers0