Making a java .jar executable

This is just a brief tip on how to simply wrap a java .jar file into an executable. This approach does no error checking, and it is up to the user to ensure that you are passing the appropriate variable.

The simple solution is to make an executable with the full path to the .jar file and pass the arguments to it:

#!/bin/bash
java -jar /full/path/to/file.jar $@

For example, for trimmomatic:

!/bin/bash
java -jar /usr/local/java/trimmomatic.jar $@

Then make that executable and make sure it is in your path.

chmod +x script.sh

Now you should just be able to call script.sh directly