by Daniel H. Steinberg

The Macintosh Runtime for Java: What it is and where it’s heading

news
Sep 1, 19976 mins
Core Java

Finally -- an explanation of how Sun and Apple's version numbers match up and what to expect from Java tools for the Mac!

As announced in JavaWorld last month, Apple has just upgraded its version of the Macintosh Runtime for Java (MRJ) from 1.02 to 1.5, and has made it available for download from the Apple Web site. (See the Resources section for a link to this site.) What you may not know is how the version numbers match up to the JDK version numbers. Apple’s numbering system does not directly correspond to Sun’s system for the JDK, which causes a bit of confusion. Here’s the rundown: Apple’s MRJ 1.0 corresponded to JDK 1.0.2 and includes JManager and JBindery. The recently released MRJ 1.5 also corresponds to JDK 1.0.2 and adds the JIT (just-in-time compiler) and the MRJ Toolkit.

Those developers who used tools other than MRJ might not be familiar with JBindery, a utility that lets you create double-clickable standalone Java applications. In addition, JBindery encapsulates command-line arguments.

Two questions come to mind:

  1. Are these really standalone? Mostly. These applications run on any Mac that has MRJ 1.0.2 installed. Since the MRJ is being incorporated with all future OS releases, this base will grow.

  2. How can these self-contained, double-clickable applications on a Mac possibly comply with 100% pure Java? They can’t β€” at least they can’t if you want to support every feature available on the Mac. For example, you can’t yet support drag-and-drop or Quicktime. If you stay away from Mac-specific features, you can write 100% pure Java applications using JBindery by selecting an option that places the regular binary files in the data fork and the Mac-specific information in the resource fork.

What’s in store for MRJ this year?

Finally, a Mac version of JDK 1.1 will be released as part of MRJ 2.0. Although Sun did not deliver on its promise to release the Mac version of JDK 1.1 by the end of the second quarter 1997, Apple insists the alpha version of MRJ 2.0 will be available in the coming weeks. Apple’s Java product manager, Will Iverson, says the alpha version will be feature-complete and that the beta version should follow shortly after the alpha version. Shaan Pruden, Apple’s Java for MacOS evangelist, said MRJ 2.0 will include JDK 1.1, 1.1.1, 1.1.2, and JDirect. JDirect will give Java programmers easier access to the Macintosh Toolbox. Once Mac programmers and end users have the power of Java 1.1, they too will be able to take advantage of JDBC and JavaBeans. Look also for javadoc and printing to be supported in MRJ 2.0.

The Mac alpha release of JDK 1.1 that comes in MRJ 2.0 will follow by least nine months the beta release of JDK 1.1 on Windows. What about JDK 1.2? In the July 1997 JavaWorld article β€œJava development on Macintosh β€” is it viable or not?” Iverson explained that Apple has β€œa closer working relationship with JavaSoft,” and indicated that the JDK 1.2 release for the MacOS should be very close to that for Windows. Apple is already working on 1.2. Pruden says we can look for β€œ1.2 support in early 1998 in MRJ 2.x, which will also include features that didn’t make it into 2.0.”

A look farther down the road

Further down the road is Apple’s new operating system, Rhapsody, which is not just an incremental change to the existing Mac OS. Rhapsody for the PowerPC consists of a Yellow Box, a Blue Box, and a Java Runtime, which sit on top of the Mac microkernel. The Blue Box is for running current Mac OS applications. The Yellow Box is based on OpenStep (from Next) and runs on many different CPUs and kernels. In addition to the version for the PowerPC, there also will be a version of Rhapsody for Intel that includes the Yellow Box and Mach microkernel. Apple’s plans are actually more ambitious. There is a version of the Yellow Box that will run on top of the Mac OS and a version that will run on top of Windows 95 or NT. Because these versions will be restricted by the underlying operating systems, they won’t be able to take advantage of all of the power and features of the Yellow Box.

You currently can run Java on a Mac running system 7.5 or higher. Although Apple promises to continue to support the current OS for a while, Apple Rhapsody evangelist Leon Baranovsky encourages developers to build Java-based applications for Rhapsody. β€œApple will open the yellow frameworks to Java, said Baranovsky.” The developer release of Rhapsody will be available in January 1998.

Iverson claims that Apple views Java as having three main components: the language, the VM, and the libraries. Java is a primary language for the Yellow Box. According to Apple’s Baranovsky, β€œyou’ll be able to use Java to get to native frameworks.” Because the Yellow Box also will be available on Intel platforms, Baranovsky adds that β€œYellow-Box applications are cross-platform executable to Yellow Box.” In other words, if you write an application to the Macintosh Yellow Box, whether it is in Java or not, it will run on any other system that also has a Yellow Box.

The Rhapsody Java runtime is a core part of the OS. For developers, it looks as if Apple’s Java support in Rhapsody is evolving toward an integrated development environment (IDE) by virtue of the tools that will be available as part of Rhapsody. The Interface Builder is a tool for laying out the user interface, and the Project Builder, the IDE, helps developers organize files. Baranovsky advises that β€œJava doesn’t share libraries, it creates multiple instances of the libraries.” He also predicts that Java 2.0 will be out on the Macintosh by mid-1998.

Given Apple’s history, the MRJ timelines and announcements probably will be greeted with skepticism from developers who have heard it before. During the Macworld sessions, Apple engineers and evangelists kept repeating the Apple mantra, β€œunder-promise and over-deliver” (and all of them then paused to make sure they didn’t reverse it). The fact that Java is a part of the current Mac OS and is central to Rhapsody should make developers feel confident about the commitment of Apple to Java on the Mac.

Daniel H. Steinberg is a visiting assistant professor of Mathematics at Oberlin College. He learned to program in C (by reading Kernigan and Richie, and asking friends) and C++ on a Macintosh to help his research on elastic curves in hyperbolic space. Object-oriented design is the way mathematicians view the world and so programming in Java was an obvious next step. Daniel taught an introductory course in Java at John Carroll University last spring and spent the summer preparing for fatherhood.