2

I need to make a simple executable text file (preferably via chmod +x, but that isn't necessary) that runs a .jar file and passes in JVM arguments as well as jar-specific args. It must also run in terminal sp I can see the ouput.

#!/bin/bash
java -Xmx4G -Xms2G file.jar nogui

where nogui is the program-specific argument, doesn't seem to do anything when run in terminal (it doesn't even open a terminal window).

  • 2
    Possible duplicate of [How to execute a script just by double clicking like .EXE files in Windows?](http://askubuntu.com/questions/138908/how-to-execute-a-script-just-by-double-clicking-like-exe-files-in-windows) – muru Oct 16 '15 at 02:45

1 Answers1

1

To run a JAR file via java you need the switch -jar.

#!/bin/bash
java -Xmx4G -Xms2G -jar file.jar nogui
cl-netbox
  • 30,845
  • 7
  • 93
  • 131
A.B.
  • 89,123
  • 21
  • 245
  • 323