0

I have made a java swing program and created an executable jar file via jar cfm Game.jar MANIFEST.MF *.class in terminal. When I try to run the jar file through terminal, it works fine. But when I try to run the file by double clicking the icon, nothing happens. MANIFEST.MF:

    Manifest-Version: 1.0
    Main-Class: Game

I have mac os 10.6 and the default app to open jar files is jar launcher.

Nosrep
  • 521
  • 7
  • 21
  • 1
    Possible duplicate of [jar file doesn't open upon double click](https://stackoverflow.com/questions/9259389/jar-file-doesnt-open-upon-double-click) – Glains Jul 04 '18 at 19:51
  • @Glains [jar file doesn't open upon double click](https://stackoverflow.com/questions/9259389/jar-file-doesnt-open-upon-double-click) is for windows os. I have mac os. – Nosrep Jul 04 '18 at 19:57
  • I wanted to point out the fact that you might need to associate to run jar with a default program. – Glains Jul 04 '18 at 20:02
  • @Glains Associate what? – Nosrep Jul 05 '18 at 00:38

1 Answers1

0

Terminal and Finder don't necessarily use the same version of Java:

"When starting a Java application through the command line, the system uses the default JDK. It is possible for the version of the JRE to be different from the default version of the JDK"

https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-macos.htm#JSJIG-GUID-C5F0BF25-3487-4F33-9275-7000C8E1C58C

jazzwhistle
  • 337
  • 2
  • 12