I have an application packaged as a jar file on my mac. I wish to launch this app from the dock as if it is a .app file. Is there a way to do this?
3 Answers
Sure. JAR files can be launched just like .app
s can. Just drag the JAR to the section of your Dock closest to the trash can (it won't work in the main section of your Dock, as that area is reserved for .app
s), on the other side of the little separator. Keep in mind that Lion (OS X 10.7) doesn't come with Java pre-loaded, so you may have to download the Java Runtime Environment (JRE) to run JARs.
(Also, this question is much better asked over on Ask Different, the Apple Stack Exchange site.)
-
I never would have figured this out. Is there a way to give the jar a dock icon? Nov 8, 2020 at 1:35
You can create a workflow with Automator, add a 'Run Shell Script' step and save it as an application. Something like this:
java -jar /path/to/your/file.jar
You can then just pull it into your doc (and give it an icon if you like)
-
1Here's a video that shows a step by step youtube.com/watch?v=kwdK6Dg1a_Y Of course, you still need Java. May 7, 2017 at 17:10
Yes, you should let the file closest to the trash. Otherwise, it could not be attached in the dock.