This question already has an answer here:

Despite following the recommended command line for .jar file :

java -jar imker-cli.jar

It doesn't work for me :

me@pc:~/Documents/imker$   java -jar imker-cli.jar
The program 'java' can be found in the following packages:
 * default-jre
 * openjdk-8-jre-headless
 * gcj-4.8-jre-headless
 * gcj-4.9-jre-headless
 * gcj-5-jre-headless
 * gcj-6-jre-headless
 * openjdk-9-jre-headless
Try: sudo apt install <selected package>

What is going on ? What should I do to run this .jar file ?

marked as duplicate by wjandrea, Ravexina, Byte Commander, karel, user364819 Jun 19 '17 at 7:34

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.

  • See top answer: "If you don't have java installed, you can fix that by installing the default-jre package." – wjandrea Jun 18 '17 at 15:31
  • oh ! I understood the error message as "you already have java in the following packages: [...]". Thanks to your comments I understand I must install it. Thanks ! – Hugolpz Jun 18 '17 at 15:39
  • 1
    @wjandrea it's not a duplicate of that, as they're already doing java -jar, which is the answer to that. – Chai T. Rex Jun 18 '17 at 15:53
  • @ChaiT.Rex The top answer also describes how to install Java. – wjandrea Jun 18 '17 at 16:12

The error message you got ask you to install java. Run :

sudo apt-get install default-jre

and it should work.

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