1

I have compiled my jar file using jar cmf manifest.mf SysInfo.jar *.class and got no errors, but when I try to execute the file by clicking on it nothing happens. I don't even get an error pop up. But when I run the jar using the console it will execute perfectly.

What can I do to make the file run by clicking it?

nbrooks
  • 18,126
  • 5
  • 54
  • 66
meme
  • 27
  • 8
  • What kind of application is in the jar? Is it a command line app? Also, how are you running it from the command line (which command are you using)? – RudolphEst Jan 06 '17 at 13:36
  • 1
    Please provide more information: How do you start it successfully from the console? How does the manifest file look like? – hotzst Jan 06 '17 at 13:39
  • What os? Essentially you have to tell your os what to do with jar files. – matt Jan 06 '17 at 13:52
  • **If Windows using console I/O and not GUI**: dupe http://stackoverflow.com/questions/10446986/double-clicking-jar-file-does-not-open-command-prompt with alternate in http://stackoverflow.com/questions/30540902/cant-open-jar-using-double-click-only-with-cmd . – dave_thompson_085 Jan 06 '17 at 20:35

1 Answers1

0

Try starting it via console using

java -jar yourFile.jar

Don't forget to cd in the directory your .jar file is located before you do this.

EDIT: Sorry, you already said it works like that. Try right click open with.. and then choose open with javaw.exe If that also doens't work you need to provide more information.

Sven G.
  • 16
  • 1
  • javaw only exists on Windows where it is already the default, and doesn't work if the program uses console I/O which I'm guessing is the problem, see links above. – dave_thompson_085 Jan 06 '17 at 20:37