I'm using Elementary OS. How do I mark a .jar file as executable. I do have JDK installed, but I get an error saying it isn't marked as executable.


You can either open a terminal and run

chmod +x yourfile.jar

or right-click the file in the file manager, open the Properties window, switch to the Permissions tab and check the Execute box in the Owner: row.1

1: At least that's the way it works in Nautilus/Files (GNOME's default file manager) which Pantheon's Files seems to be resembling quite closely.

You could also avoid the need to mark it as executable by using the Java executable to invoke it:

java -jar yourfile.jar
  • I tried using nautilus to go to properties and check the box with execute but the second after I check it, it unchecks by itself,which is really wired.... – Danny Bejan Dec 24 '13 at 13:56
  • Have you tried setting it using chmod and checking if it persists? – n.st Dec 24 '13 at 14:03
  • I managed to run it with chmod eventually...Thank you! – Danny Bejan Dec 24 '13 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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