This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Java in Windows and  MacOS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Java in Windows and  MacOS" Watch "Java in Windows and  MacOS" New topic

Java in Windows and MacOS

Mohamed anvar sithik

Joined: Jan 28, 2005
Posts: 7
I have written a java program in Windows platform. If i am going to
write the same program using java in Mac OS . Is we need to change any thing in the program to make it comapatible with Mac OS.

For eg., If my program in windows is going to refer the windows registry. But in Mac OS there is no concept of registry . How to make make it compatible for both OS.
Jason Kingsley

Joined: Feb 21, 2004
Posts: 18
If you use platform specific functionalilty, of which the Windows Registry is definately one, then you simply cannot use the the functionality "as is".

What you will have to do is abstract away the notion of the underlying mechanism. One way is to have your code talk to either an interface/abstract definition of the functionality that you want. Your other layers of code do not (should not) care about the underlying implementation. Then you can strategise the concrete implementation specific for the platform, it will then be easily extensible should you move to other platforms.

If you don't know about design patterns, you may wish to brush up on the famous patterns (by the "gang-of-four") to gain a better understanding of the mechanisms used and how you can apply them to your problem. Such things as these provide the logical solutions for such problems.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Java in Windows and MacOS
It's not a secret anymore!