Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launching a jar file as an app on Mac (from the dock)

Tags:

macos

jar

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?

like image 341
whwright Avatar asked Jan 18 '12 19:01

whwright


People also ask

Can Mac use JAR files?

jar is executable. Because Mac OS X ships with the Jar Launcher application, the end user needs only double click on the jar file and the application will launch. To make the jar file executable, the manifest must include the name of the Main class file.


1 Answers

Sure. JAR files can be launched just like .apps 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 .apps), 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.)

like image 88
piersadrian Avatar answered Sep 21 '22 15:09

piersadrian