This question already has an answer here:

I've just got a new PC running Ubuntu 16.04 and have transferred my work from my laptop running Ubuntu 14.04.

I have an executable jar file called timed_hri.jar.

On my laptop I can go to the directory and type ./timed_hri.jar and it runs. However, on my desktop it doesn't, I need this to run as I have a Python script that relies on using the ./ command on the file.

This is the output when I try it on my PC:

./timed_hri.jar: line 1: $'PK\003\004': command not found
./timed_hri.jar: line 2: $'\bne\355H': command not found
./timed_hri.jar: line 3: syntax error near unexpected token    `$'NX\252\276!\227\230iP\275餰  \364g\354\002aF\325\\\213G\263\225\3021B\305Q\237\336\337\375\301t\367\315 N?\372\275Z\235\031BB\3452/\231\241\266\377Z''
./timed_hri.jar: line 3:me�H6�8��META-INF/MANIFEST.MFM��!{��R

marked as duplicate by karel, Community Jul 13 '16 at 15:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Try running java -jar ./timed_hri.jar – Nick Weinberg Jul 13 '16 at 15:08
  • Yeah, it works with that. Is there something I can do to get the direct ./ command to work on its own back? – oodles2do Jul 13 '16 at 15:14
  • 1
    ^ particularly @David 's answer: askubuntu.com/a/291514/546208 – Nick Weinberg Jul 13 '16 at 15:19
  • Thanks for your help! I hadn't seen that question in my searches. David's response worked, I can now do ./ :). How do I mark your answer as correct? – oodles2do Jul 13 '16 at 15:22
  • If an answer in a different question helped you, upvoting it will help future users to more easily find the same answer. – karel Jul 13 '16 at 15:29