So I created JAR file. I set main class in manifest. When I run it from command line program launches. But when I click JAR file icon it opens and shows it directiories, but doesn't run. How to make system run JAR file on double-click insteand of opening it? Im using Ubuntu Linux
Asked
Active
Viewed 1,083 times
0
-
Do all the JAR files (even those you didn't create) act like this? It may be a Windows configuration problem. Look at http://stackoverflow.com/questions/394616/running-jar-file-in-windows – Cyrille Ka Feb 23 '13 at 20:14
-
But Im using Ubuntu. Maybe its ubuntu problem? In one post there was tutorial in which author was doing the same steps as me. And he showed that it works on his Windows 7. So maybe it doesnt work on ubuntu but will work on Windows? – user2102972 Feb 23 '13 at 20:16
-
Oh, sorry, I don't know why I assumed you were on Windows. It's obviously the window manager/desktop environment problem if it works from command line but not in the desktop. I don't have a Ubuntu right now to test that, but there must be some configuration tools for file associations. – Cyrille Ka Feb 23 '13 at 20:20
2 Answers
1
Mark the jar file as executable, and set JRE as program for opening Jar files.
0
Try, right-click on the .jar file, then choose Open With Other Application... -> Java. If it works, then right-click on the .jar again, choose Properties. On the properties window, choose Open With tab. Here you can configure the default application for file types (like jar).

Quirin
- 738
- 1
- 5
- 15