Welcome to the Mac OS X Java Frequently Asked Questions (FAQ) for developers. This page is intended to provide answers to frequently asked questions about the current features of Java on Mac OS X, as well as common development questions and problems. If after reading the Java Developer FAQ, you still have a question, please contact us. |
||
How can I get Java for Mac OS X?Every version of Mac OS X comes with Java out of the box. No download, installation, or setup is necessary to run applications, view Applets, or even build your own Java code from the command line. New Java releases are made easily available through Software Update, and developer packages can be found at the Java Downloads page.
Which version of Java does Mac OS X include?Mac OS X Leopard comes with J2SE 5.0 preinstalled, based on JDK 1.5.0_13_b05. A 32-bit client and 64-bit server VM are available. Mac OS X Leopard also includes JDK 1.4.2_13 which is deprecated. JDK 1.5 is strongly recommended for the best performance, compatibility, and customer exposure. For information on earlier releases of Java on Mac OS X, please see the Java Version Strings section of Technical Note TN2110.
Which Java version do Applets use?Java Applets inside Safari can be configured to run any installed Java version by using the Java Preferences application.
How can I switch between multiple versions of Java on my Mac?The Java Preferences application allows users to choose which version is used by applications, Applets, and command-line tools. Apple developer tools such as Jar Bundler and Xcode both allow you to request a minimum or specific Java version for double-clickable applications. Please see the Java 1.4 Info.plist Dictionary Keys documentation for details.
Can I remove a Java update after I've installed it?Java on Mac OS X is updated incrementally through numerous releases. Therefore, the only way to revert to an earlier Java installation is to reinstall the operating system. The same applies for any other Java-related Software Updates or Developer Previews. For this reason, it is strongly recommended that Developer Previews of Java on Mac OS X be installed on non-critical systems.
Can I bundle the Mac OS X JDK with my application?Java is included as part of Mac OS X, and is not available for re-distribution by 3rd-party developers.
Do updates to Mac OS X also update Java?Java updates usually stand alone, allowing you to choose when an update is appropriate. However, it is always recommended to check the description and release notes for all software updates to see which technologies are affected. Major upgrades such as Mac OS X Leopard typically update Java as well.
Where can I get general Java programming help?While Apple currently does not offer any "Java beginner" content, there are plenty of areas dedicated to starting off with Java:
Join Apple’s java-dev mailing list to discuss issues specific to Java development on Mac OS X. Where is "Java Home" on Mac OS X?Technical Q&A 1170 discusses the Mac OS X Java home, extension and preferences directories. How do I build and deploy JNI libraries on Mac OS X?The details of JNI development on Mac OS X are explained in Technical Note TN2147 and Building a JNI Universal Application With Xcode.
How do I handle the items in the Mac OS X Application menu?Responding to the application menu is discussed in the Making User Interface Decisions section of the Java Development Guide for Mac OS X. The OSXAdapter sample illustrates how to use them in a way that will still run correctly on other platforms. How do I find out which Java version my app is using?Sometimes you may need this information to implement a specific feature or to implement a workaround to a bug that has been fixed in later releases. Technical Note TN2110 discusses how to best do this, along with a comprehensive list of version strings for every Java release on every version of Mac OS X. |