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).

1

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

#!/bin/bash
java -Xmx4G -Xms2G -jar file.jar nogui
  • wow, I can't believe I missed that. I knew I needed it, just one of those oops moments. thanks – Hunter Robertson Oct 16 '15 at 16:32

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.