Forums Register Login

How To Painlessly Install JRE And Application To Mac For End-user?

+Pie Number of slices to send: Send
What are developers doing to run their software on a Mac? Is there a way to create an installer, for free, that will detect and install missing or out of data JRE on a Mac silently?

I have an app that I am working on and right now it is just for Windows but I am considering a Mac version as well.

TIA

NB
+Pie Number of slices to send: Send
 

Noble Bell wrote:What are developers doing to run their software on a Mac? Is there a way to create an installer, for free, that will detect and install missing or out of data JRE on a Mac silently?



Please be more precise, questions are not clear. Especially first one.
+Pie Number of slices to send: Send
Ok.

What I want to know is this...

If I develop a software application using Java 8 and I want customers to be able to run it on a Mac that has Java 7 or below, what do I need to do in my installer package to insure:

If the user's Mac does not have the correct version of Java, the installer will install it, silently, for them along with my application.

I hope I am making this clearer. I am not really sure how else to describe it.
1
+Pie Number of slices to send: Send
Luckily, OS X will prevent you from stealthily installing anything. The last thing people want is to have things installed against their wishes or without their knowledge. If your application requires Java 8, make this known to your customers and require them to install Java 8 instead of surreptitiously trying to do it under the covers.

You can help this along by providing clear instructions on how to do so.
+Pie Number of slices to send: Send
 

Bear Bibeault wrote:Luckily, OS X will prevent you from stealthily installing anything. The last thing people want is to have things installed against their wishes or without their knowledge. If your application requires Java 8, make this known to your customers and require them to install Java 8 instead of surreptitiously trying to do it under the covers.

You can help this along by providing clear instructions on how to do so.



I assume that this is the way that Java developers deliver the applications to Mac users? Could it be something placed in the installer telling the user they need to install Java 8 and then ask them if it can be installed and then have the installer do it?

+Pie Number of slices to send: Send
That would be a better, and more acceptable approach. I can tell you that I would be livid if something changed my Java version.
+Pie Number of slices to send: Send
In addition, since you're talking about installation process, it is worth to mention, that os x (unix) is completely different operating system comparing to windows. I'm afraid you're trying to think and plan the tasks for yourself a bit too fast and too far.
+Pie Number of slices to send: Send
You should however write exactly the same Java® code for OsX as for Linux and Windows®. The only difference in the installation should be the version of JVM you install.
+Pie Number of slices to send: Send
And welcome to the Ranch
+Pie Number of slices to send: Send
 

Campbell Ritchie wrote:You should however write exactly the same Java® code for OsX as for Linux and Windows®. The only difference in the installation should be the version of JVM you install.



Ritchie, even that is not always true.

For ex.: javax.swing.JFileChooser doesn't work on OS X as works on Windows.
+Pie Number of slices to send: Send
You might want to consider using Java Web Start* to 'deliver' your application. More on it here http://docs.oracle.com/javase/tutorial/deployment/webstart/
You definitely should read and understand the security section before you make any decision though.

Mac OS offers some tips, tools and tricks to make your application more 'native'
Check out all the useful links and information listed on the FAQ section here https://coderanch.com/how-to/java/MacOsxFaq
+Pie Number of slices to send: Send
 

Liutauras Vilda wrote: . . .

For ex.: javax.swing.JFileChooser doesn't work on OS X as works on Windows.

Which means OP would have to avoid using a file chooser.
+Pie Number of slices to send: Send
I was unaware of the file chooser being different. I am glad I am doing my research first. I will check into the links that were provided. If Swing is an issue, would SWT be more native in this case?

I have never developed a complete program for Mac in Java before. All of my software has been written in the past for Windows only. Being a longtime iMac owner, I have not developed a Mac program in Java before and I wanted to give it a try with planned upcoming application re-write.

Would Web Start be similar to Visual Studio's Click-Once deployment? I have not looked at Web Start at all as a viable install solution.

Thanks for all the great information and I am glad to be a member of the forum. I am enjoying this site greatly.

NB
+Pie Number of slices to send: Send
 

It is similar to Java Web Start for the Java Platform or Zero Install for Linux.


http://en.wikipedia.org/wiki/ClickOnce
+Pie Number of slices to send: Send
 

Noble Bell wrote:I was unaware of the file chooser being different. . . .

So was I. That was the first I had heard of it.

Liutauras Vilda, please explain the differences.
+Pie Number of slices to send: Send
Well,

Currently in one application I use this piece of code lines below to open file chooser (works perfectly fine on Windows, does what it has to do in further process..)(BUT it doesn't work on MAC OS X - 1st bit of code executing and loading, 2nd bit simply nothings happening).
Can't provide more deep explanation what's happening, as I don't have my machine over here. Will try to do so later today.

But still, at least it tells one, that code not all the time is the same on all platforms. I might wrong in some case, as I need better to investigate what's happening, but from the first point of view, it should work on both platforms, as here is nothing exotical (win, mac os x).




+Pie Number of slices to send: Send
That is not how you use a file chooser. It should readThe argument to the showOpenDialog method is the Component you wish the dialogue to appear in front of. If you are in a non‑GUI environment you usually use null, which means the dialogue appears in the centre of the screen (though in my experience it can appear “behind” other windows and be difficult to find). How can a dialogue appear in front of the chooser which is usually not visible? If you are in a GUI environment you have to pass the identifier of a Component which is visible. The dialogue will appear probably centred in front of that Component.

JFileChooser API link
JFileChooser Java® Tutorials link
+Pie Number of slices to send: Send
 

Campbell Ritchie wrote:That is not how you use a file chooser.



Will try it tonight, hopefully you're right.
Thank you for an advise on that.
+Pie Number of slices to send: Send
You're welcome
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 769 times.
Similar Threads
Swing application on mac os 9
32-bit vs. 64-bit shared libraries
Java for e-learning chat room??
Java GUI - what to choose - Swing, JSF, JavaFX, other?
Packaging JRE
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 03:04:30.