Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC

Java Frequently Asked Questions

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 direction and current features of Java on Mac OS X, as well as common development questions and problems. Due to the high volume of email we receive, we cannot respond to every question or suggestion, but we are interested in what you have to say. If after reading the Java Developer FAQ, you still have a question, please contact us.

Please note that the “Common Development Questions” and “Known Issues” sections pertain to J2SE 1.4 or later unless otherwise noted. For 1.3.1 development issues, please see our Java Documentation section for Technical Notes and Q&As regarding J2SE 1.3.1 on Mac OS X.



Common Development Questions

  1. How does the current Intel announcement affect Java developers?
  2. Where can I get general Java programming help?
  3. Where is "Java Home" on Mac OS X?
  4. Can I bundle the Mac OS X JDK with my application?
  5. How do I build and deploy JNI libraries on Mac OS X?
  6. How do I handle the items in the Mac OS X Application menu?
  7. How do I know which Apple Java release my app is running on?


1. Does the transition to Intel processors affect Java developers?

Probably not; the potential concerns for Java developers regarding Intel-based Macintosh computers are discussed in Technical Q&A QA1295. Please note that Java 1.3 is not supported on Intel-based Macs; J2SE 1.4 and 5.0 (1.5) are supported.
Back to Top 

2. Where can I get general Java programming help?

Apple currently does not offer any "Java beginner" content. There are plenty of excellent areas dedicated to starting off with Java:

  • The Java Tutorial - A thorough introduction from Sun, the creators of Java
  • Java Discussion Forums - Mailing lists and online forums hosted by Sun for all levels of Java development.
  • JGuru - A website dedicated to Java development. FAQs, tutorials, forums, etc.

For issues specific to Java development on Mac OS X that are not addressed in this FAQ, please see Apple’s java-dev mailing list.
Back to Top 

3. Where is "Java Home" on Mac OS X?

Technical Q&A 1170 discusses the Mac OS X Java Home, Java extension and preferences directories.
Back to Top 

4. Can I bundle the Mac OS X JDK with my application?

Apple currently includes J2SE implementations as part of Mac OS X, and will provides updates through the Software Update mechanism. We have no plans to package current or earlier releases of our J2SE implementation for re-distribution by 3rd-party developers. Please refer to Java 1.4 Info.plist Dictionary Keys for instructions on specifying a major version of Java in your application (1.3/1.4/1.5).
Back to Top 

5. 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.

The naming convention for JNI libraries is libXXX.jnilib, where XXX is the name of your JNI library as specified by your Java code’s System.loadLibrary call. jnilibs belong in the Contents/Resources/Java subdirectory of an application bundle or in one of the extension directories recommended in Technical Q&A QA1170. Any other locations will need to be specified using the java.library.path system property when starting your application, either using -D from the command line or within the Java->Properties subdictionary of a double-clickable app’s Info.plist file.
Back to Top 

6. 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. A new Java Swing Application in Xcode demonstrates use of these APIs, and the OSXAdapter sample illustrates how to use them in a way that will still run correctly on other platforms.
Back to Top 

7. How do I know which Apple Java release my app is running on?

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.
Back to Top