2

When I run the *.jar file my Ubuntu pops up an error message with

The file /... is not marked as executable. If this was downloaded or copied from an untrusted source, it may be dangerous to run.

Though when I right clicked the *.jar file and got to its Properties > Open With, the Default Application to open this kind of file was already set to OpenJDK Java 7 Runtime.

What is wrong here?

RegarBoy
  • 121
  • 5
  • 2
    You have to give it the executable bit to run it, or use `java filename.jar` to execute it (replace filename accordingly) – Thomas Ward Mar 14 '16 at 18:55

2 Answers2

5

1) Open a terminal (CTRL+ALT+T)

2) cd into the directory containing the Jar file

3) sudo chmod +x yourfile.jar (Replace filename)

4) java -jar yourfile.jar (Replace filename)

You'reAGitForNotUsingGit
  • 14,669
  • 9
  • 48
  • 83
3

Open the properties again, select the tab "Permissions" and mark the checkbox "Allow executing file as program".

file properties - Permissions tab

cmks
  • 1,874
  • 1
  • 11
  • 17