M BUZZ CRAZE NEWS
// general

How do I make a Java JAR file executable in Linux Mint? [duplicate]

By John Parsons

This is the notice I get:

The file '/home/heart/Phantombot/PhantomBot-2.4.1/PhantomBot.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.

Basically, the JAR file doesn't have the necessary permission to run. How do I give it this permission?

2

1 Answer

To add executable bit to a file, use this construction:

chmod +x /path/to/file

The command for your jar file is

chmod +x /home/heart/Phantombot/PhantomBot-2.4.1/PhantomBot.jar

if you'are owner of the file.

If you aren't owner of the file, use leading sudo:

sudo chmod +x /home/heart/Phantombot/PhantomBot-2.4.1/PhantomBot.jar