< Previous PageNext Page > Hide TOC

Apple Developer Tools for Java

This article provides a broad overview of recommended tools for Java development. It covers integrated development environments (IDEs) from other manufacturers, Apple’s own Xcode IDE, the Jar Bundler application, and methods for obtaining and viewing documentation.

Contents:

JDK Tools in Mac OS X
Java IDEs
Xcode Tools
Other Tools
Developer Documentation


JDK Tools in Mac OS X

The Java development tools in Mac OS X are similar to the tools you find on other UNIX-based platforms. The command-line tools that Sun provides as part of the JDK for Linux and Solaris are ported for Mac OS X and work just as they do on those platforms. There are only a few significant differences between the standard JDK tools in Mac OS X and those found on other UNIX-based platforms:

Java IDEs

Java development on any platform often benefits from the use of an Integrated Development Environment (IDE), which provides a more fluid workflow between writing, compiling, running, debugging, and packaging Java code than a simple text editor and the command line. Different IDEs offer unique features and are often suited for different kinds of Java development. These IDEs are industry leaders and offer substantial support for Mac OS X:

If you are developing a JNI library or intend to have your application communicate with Cocoa, you should plan to use the Xcode Tools for those portions of your development. For more information on JNI development, see “JNI.”

Xcode Tools

Apple provides a full suite of general developer tools with Mac OS X. This suite of tools, the Xcode Tools, is free but not installed by default. The tools are available for download at the Apple Developer Connection (ADC) Member Site http://connect.apple.com/. If you do not have an ADC membership, you can enroll for various levels of membership, including a free online membership that allows you access to the member site, at http://developer.apple.com/products/.

Get the Current Tools

Apple frequently releases updates to both the Mac OS X Developer Tools and developer documentation. Even if you already have the Xcode Tools installed, you should check the Member Site for the most up-to-date versions of both.

The Xcode Tools are available from the Downloads link. There are two components to download that together give you the full Java development environment for Mac OS X. The Developer Tools section contains the base Xcode Tools. Download and install the most current released version available. There are Java–specific updates to developer documentation that are available in the Java section. Download and install these as well.

With the Xcode Tools and the Java documentation updates, you have a full-featured development environment including:

To remain current with Apple documentation between updates to the Xcode snapshot, visit the Mac Dev Center Reference Library at http://developer.apple.com. The Reference Library includes RSS feeds that announce documentation updates for many technologies, including Java. Subscribe to these feeds at http://developer.apple.com/rss.

Xcode

The core component of the Mac OS X development environment is Xcode. Xcode is a complete IDE that allows you to edit, compile, debug, and package Mac OS X applications written in multiple languages. Even if you do not intend to use it for your primary Java development, it is helpful to become familiar with Xcode. Downloadable sample code and the sample code installed in /Developer/Examples/Java/ are both usually provided as Xcode projects. Additionally, there are some elements of documentation viewing that are available only through Xcode.

For more on using Xcode for Java development, see the Xcode Help menu.

The Xcode Organizer

Xcode helps you manage Java applications with the Organizer. You can open it by choosing Organizer from the Window menu. Figure 1 shows the Organizer window.


Figure 1  The Xcode Organizer


The Organizer shows your project exactly as it is laid out in the file system. This is in contrast to the main Xcode project windows, which allow you to arrange files arbitrarily without altering their location on disk. The Organizer’s direct reflection of the file system better serves Java development and is similar to other Java IDEs.

To create a new Java project in Xcode, choose New From Template from the New menu in the bottom-left corner of the Organizer.

Xcode and Ant

Xcode uses Apache Ant to compile and run Java applications. You can customize your build settings by modifying the build.xml file that is automatically generated when you create a new Java project. By default, the source and target compiler flags in build.xml are set to 1.3 and 1.2, respectively. This is to ensure compatibility with as many Java versions as possible. Raise these default values to take advantage of APIs and features, such as assertions and generics, that are available only with later versions of Java.

Jar Bundler

Jar Bundler is an application that takes Java applications deployed as standalone Jar files and turns them into applications that can be launched just like native Mac OS X applications. Although the Terminal application is a part of every installation of Mac OS X, many Mac OS X users never use it. To prevent your users from having to use Terminal for your Java applications, you should wrap your application as a Mac OS X application bundle (see “Mac OS X Application Bundles”). Jar Bundler allows you to do this very easily. It also provides a simple interface for you to set system properties that make your applications perform their best in Mac OS X.

Jar Bundler is installed in /Developer/Applications/Utilities/. More information on Jar Bundler is available in Jar Bundler User Guide.

Applet Launcher

Applet Launcher (in /Developer/Applications/Utilities/) provides a graphical interface to Sun’s Java Plug-in. Applet Launcher loads an applet from an HTML page. For example, entering the following URL launches the ArcTest applet:

file:///Developer/Examples/Java/Applets/ArcTest/example1.html

Applet Launcher is useful for testing your applets in Mac OS X. Performance and behavior settings for applets may be adjusted in the Java Preferences application installed in /Applications/Utilities/Java/.

Other Tools

In addition to containing Applet Launcher, /Applications/Utilities/Java/ contains these Java-related tools that you might find useful when testing your application:

In addition to containing Xcode and Jar Bundler, /Developer/Applications/Utilities/ contains some applications that you can use for Java development though they are not Java-specific:

Additional development tools for Java and other languages can be found in /usr/share/. Of particular use for Java development are:

Developer Documentation

Documentation for Java development in Mac OS X is provided both online and locally with the installation of the Xcode Tools. The most current version of the documentation is available from the Java Reference Library on the Apple Developer Connection website. A snapshot of this documentation is also installed on your computer when you install the Mac OS X Developer Tools. This documentation is easily accessible in Xcode by selecting Documentation from the Help menu. Man pages for the command-line tools are accessible from the command line man program and through the Xcode Help menu.

Note that Apple does not attempt to provide a full Java documentation suite online or with the Xcode Tools. Sun supplies very thorough documentation available online at http://java.sun.com/reference/docs/. Apple’s documentation aims to augment Sun’s documentation for Java development issues specific to Mac OS X and to document Mac OS X–specific features of Java. Your primary source for general Java documentation is Sun’s Java documentation website.

Providing Documentation Feedback

If you find errors in the Java documentation or would like to request either feature or content enhancements, you can file bugs at http://bugreport.apple.com/. When filing documentation bugs on Java documentation in Mac OS X, please use Java Documentation (developer) for Component and X as Version.



< Previous PageNext Page > Hide TOC


© 2003, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-10-15)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.