1

In Linux world one can just add shebang to the jar file and create an executable, it's widely disputed though whether this is a good practice or not. My question would be - is there something similar I can add to make the jar executable both on Windows and *nix platforms?

shabunc
  • 17,863
  • 15
  • 68
  • 96

1 Answers1

1

If you have a MainClass in the jar file's manifest file and you have Java installed on your system (i.e. Java is associated with the .jar file type), then the default Java installation should be used to execute this jar.

See How do I create executable Java program?

dpr
  • 8,675
  • 3
  • 32
  • 57