I want my application to integrate Mac OS X better. I've read Mac OS X Integration for Java and I've learned I have to import com.apple.eawt.*
and write some extra code. But, if I do this, my application is not going to work on Windows because of missing reference. I could do this with preprocessor command if I write in C but this is Java. How can I do this without separating the code file into 2 branches?
On the other hand, every version of Mac OS X is a system ready to run your Java application. Included in Apple's operating system is both the JRE and JDK for J2SE v1. 3.1.
The message “Unable to load Java Runtime Environment” means that the Mac computer cannot load JRE, either because it is out of date or (more usually) because it has not yet been downloaded and installed. It can also happen after the computer OS X has been updated, e.g. to 10.14 Mojave from 10.13 Maverick.
Macify it.
I used reflection to see if the com.apple.whatever class was there, and if so, I invoked it.
Worked very well, and does not create breaking imports.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With