ikhaliq15
ikhaliq15

Reputation: 153

I made a Mac OSX app from .jar. Does end-user need Java?

I had a jar file that opened a calculator. I turned into a .app on my macintosh using a tool called JarSplice. My app works fine on my computer but I am wondering if the app will work on a the end-user who does not have Java? I would test this myself but I do not have access to a computer with Java uninstalled. Thanks ahead oft time.

Upvotes: 0

Views: 135

Answers (4)

Uise
Uise

Reputation: 29

Not if you use amipackage. It packages the jre too...

Here are the steps....

a) Download amipackage
b) Setup a config file that describes your app
c) ./amipackage.sh --config=<your config file>
d) your dmg and tar.gz are present in the out folder.

I found it very simple

https://www.amidb.com/amipackage/index.html

Upvotes: 0

martinez314
martinez314

Reputation: 12332

Yes, you can package Oracle's JRE within your app. Apple will even accept it into the AppStore.

The tool is called appbundler. This is the guide: https://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html

A fork of appbundler which adds some features can be found here: https://bitbucket.org/infinitekind/appbundler

Upvotes: 1

Jatin
Jatin

Reputation: 31724

You are at a very tricky spot mate!

Firstly thankfully you can port jre along with your application (oracle java gives you the license). The tricky part is building the dmg for your application. i.e. not only one has to port jre along, but also build it in such a manner that works like any other mac application. Including the permissions. Trust me, its quite tough to get it right.

So here are the options:

  • Go the Javafx way. Javafx has native support to build dmg files easily. This is especially nice because javafx ant has tasks that let you build dmg as part of its build system. Read this to know more. You can set icon, carry any system dependencies you want (dll or so). Set system properties etc. Definitely lets you feel very native.
  • Other non-professional but a working way. Ask the user to download java. You can provide a simple application which shows a pop-up asking user to download. Once he does, he can then double-click the jar to make it run.

I would go via javafx way. We have two desktop applications in production for windows and mac and we build it via the first way

Upvotes: 2

JJF
JJF

Reputation: 2777

Yes. End use will need Java on their machine.

Upvotes: 0

Related Questions