0

BACKGROUND: I went to oracle.com and I downloaded the JDK. I moved the file to /usr/local/java. Afterwards, I set the path variable and JAVA_HOME in /etc/environment.

PROBLEM: I have a jar file in my downloads directory. Although I can go to terminal and use "java -jar" and it works, I want to be able to double click and execute the jar file.

  • Sorry if the question sounds stupid and is obvious, I just installed ubuntu yesterday. –  Nov 27 '16 at 04:27

1 Answers1

1
  • Right click on .jar file
  • Select "Properties" tab
  • Select your Java Runtime
  • Press Set as default

enter image description here

Now you can open/execute any .jar file by double clicking them

UPDATE

If you cannot find "OpenJDK" option, maybe you don’t have the runtime environment installed. Use below command to install it.

sudo apt-get install openjdk-8-jre
Liso
  • 15,377
  • 3
  • 51
  • 80