Ubuntu – How to make a .jar file executable

openjdk

I'm trying to run a jar application under Ubuntu, so I installed OpenJDK Java 7 Runtime, but when I open this application I got this message :

The file '/home/aimad/Programms/jMerise/JMerise.jar' is not marked as
executable. If this was downloaded or copied from an untrusted
source, it may be dangerous to run. For more details, read about the
executable bit.

Best Answer

You can always run a jar file by doing java -jar JMerise.jar.

However, to make the jar file itself executable, you need to set the executable bit, as the message hints. chmod +x /home/aimad/Programms/jMerise/JMerise.jar will accomplish this.

After that you can do ./JMerise.jar to run it.

man chmod will provide you with information about how chmod works.

Also see: https://wiki.ubuntu.com/Security/ExecutableBit

Related Question