• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Noble Bell
Greenhorn
Posts: 4
Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Liutauras Vilda
Sheriff
Posts: 4928
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Noble Bell
Greenhorn
Posts: 4
Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Noble Bell
Greenhorn
Posts: 4
Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would be a better, and more acceptable approach. I can tell you that I would be livid if something changed my Java version.
 
Liutauras Vilda
Sheriff
Posts: 4928
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Liutauras Vilda
Sheriff
Posts: 4928
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 http://www.coderanch.com/how-to/java/MacOsxFaq
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Noble Bell
Greenhorn
Posts: 4
Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is similar to Java Web Start for the Java Platform or Zero Install for Linux.

http://en.wikipedia.org/wiki/ClickOnce
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Liutauras Vilda
Sheriff
Posts: 4928
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).




 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Liutauras Vilda
Sheriff
Posts: 4928
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!