installing Java apps on the mac

R

Roedy Green

What does a user have to do to run a jar on the Mac (other than JNLP),
where you actually install the jar for continued use.
 
R

Rajiv Gupta

What does a user have to do to run a jar on the Mac (other than JNLP),
where you actually install the jar for continued use.

Drag the .jar to the user's /Applications directory. Double-clicking
the .jar will launch it. The jar doesn't actually have to be in
/Applications it can be in any directory which has execute privileges
for the user.
 
J

John

Drag the .jar to the user's /Applications directory.  Double-clicking
the .jar will launch it.  The jar  doesn't actually have to be in
/Applications it can be in any directory which has execute privileges
for the user.

Rajiv is correct, but here is some more info.

Distribute your runnable jar file in a directory (folder), and have
the user copy the
directory to the applications folder. Include a command file in the
directory
worded something like:

#!/bin/sh
cd /Applications/YourDirectoryName
/System/Library/Frameworks/JavaVM.framework/Version/1.6.0/Commands/
java -cp ./YourJar.jar MainClassName

Double clicking on this *.command file will attempt to launch your
application using a version 1.6 virtual machine. If this doesn't work,
then tell your user to double click on the jar file to try and launch
it. This command file works with the older versions of Mac OS X, when
it was installed as part of the operating system. I'm not sure how it
is installed on the latest versions today.

I'm not sure about the first line of the command file above. I'm at
work on a Windows machine, and I can't test it.

Hope this is useful,

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top