Macintosh : Java Glossary


imac logo Macintosh

Apple produces a competing line of computers to the PCs called the Macintosh.

The Mac computer was named after the popular McIntosh variety of apple tree. However, presumably for legal reasons, Apple deliberately misspelled the name as Macintosh. If you correct the spelling to McIntosh (the tree and also a stereo component maker) or Mackintosh (the toffee maker), Mac users will treat you as if you had defecated on the floor, ditto if you abbreviate its name to MAC instead of Mac.

The original Macs used the Motorola 68000 series of CPUs. Then Apple switched to using the IBM (International Business Machines) PowerPC RISC (Reduced Instruction Set Computer) CPU (Central Processing Unit). All the currently manufactured Macintoshes now use Intel CPU s, the same as used in Windows and Linux/Ubuntu machines.

Unfortunately, the Power PC Mac (OS X 10.4.11) does not support version 1.6 of Java, just 1.5.Java version 1.6 is available only for the new 64-bit Intel-based Macs running Snow Leopard (OS X 10.6). Apple supplies the JVM (Java Virtual Machine), not Sun. Last revised/verified: 2010-02-17 JVM, not Sun. Last revised/verified: 2010-02-17 Java version 1.6 is available only for the new 64-bit Intel-based Macs running Leopard (OS (Operating System) X 10.5). Snow Leopard is the preview of the OS X 10.6 expected out approximately 2009-01. Apple supplies the JVM, not Sun. Last revised/verified: 2008-11-22

Java Platform Independence

Java hides many of the peculiarities of the Mac from you, such as the one-button and four-button mouse, the use of \r as a line terminator, the lack of a PC-style set environment. Java uses the System Properties which don’t rely on a set environment. The Mac now has environment variables, though their use is discouraged for native apps. They can be set for terminal sessions using the usual shell startup scripts (.bash_profile, .profile) or globally at login using a property list (~/.MacOSX/environment.plist) which can be created using the property list editor that comes with the system.

The default environment for apps run from Finder or LaunchServices includes the variables HOME, SHELL, PATH, TMPDIR, USER and LOGNAME, along with a few that appear to be specific to Apple’s JAR launcher. Apps launched from a shell inherit the shell’s environment, as usual.

To account of the different ways to request a menu popup, MouseEvent. isPopoupTrigger() will occur when somebody right clicks on a PC (Personal Computer) mouse or presses the single Mac mouse button with the control key down.

Modern Macs use \n as the line terminator, a sign of its BSD (Berkeley Software Distribution) Unix heritage. Legacy Mac software may use \r or even Windows-style \r\n. So long as you use Java’s platform-independent tools for line separator, you should be ok.

static String fileSeparatorChar = File.separatorChar;
static String lineSeparator = System.getProperty ( "line.separator" );
static String nameSeparator = File.separator; /* always 1 long */
static String nameSeparatorChar = File.separatorChar;
static char pathSeparatorChar = File.pathSeparatorChar;

The version of Java used to run apps can be changed from the Java Preferences, which is in /Applications/Utilities/Java. The section for Java Application Runtime Settings applies to Java applications, JNLP (Java Network Launching Protocol) (Web Start) apps and applets launched via Java Web Start. It also changes the default compiler version and JRE (Java Runtime Environment) libraries used at compilation

The Apple JDK (Java Development Kit) and Java Runtime includes libraries for interfacing with some of the OS, including QuickTime and parts of the NSApplication framework. The Application class in combination with OS X-specific packaging (Bundles, with an Info.plist file, documented in the FAQ (Frequently Asked Questions)) can make Java apps act very much like native apps. Apple also maintains a FAQ for Java on the Mac Platform at which includes items on using the NSApplication pieces portably.

Command Line

The default shell on a Mac is bash (in 10.4 and later releases) or tcsh (in 10.0 through 10.3); all of the usual shell-isms and unix-isms are there. Relying on GNU (Gnu’ Not Unix!) quirks (like expecting rm or cd to accept options at the end of the line) is unwise; it often won’t work as the core utilities are derived from the parent BSD code. You can, of course, install other shells.

Apps launched via Finder or LaunchServices will have standard output and standard error written to /var/log/system.log, viewable in the Console application. Apps launched from a shell have standard input, output and error connected to the shell, as usual. It is not possible to view the Applet log unless there is an error.

Keyboard Layout

The Macintosh keyboard is slightly different from a PC keyboard.

Macintosh keyboard

Keyboard Notes

Macintosh keys
Function Notes
esc Escape  
tab ⇥ Tab  
caps lock ⇪ Capslock  
shift ⇧ Shift  
control ^ Control In Java, depending on the look & feel selected, the control key might be used for copy/paste instead of the command key. Like the PC Ctrl key.
alt option Macintosh option key symbol Option aka Alt, Alternative. The option entity ⌥ ⌥ is not well supported.
apple symbol Apple symbol Apple entity is   or   Only supported in Mac fonts.
apple symbol ⌘ Command aka open Apple, clover. Used for copy/paste. The four lobed clover entity (officially called a place of interest sign) is ⌘
blank Space long unlabeled bar
return ⏎ Return Like Enter on the PC
delete Delete back delete chars to the left, like PC Backspace
delete Macintosh delete symbol Delete forward delete chars to the right, like PC Del. The delete forward entity ⌦ ⌦ is not well supported.
help ◯ Help  
home ⇱ Home  
end ⇲ End  
page up PageUp  
page down PageDown  
Up arrow  
Down arrow  
Left arrow  
Right arrow  
clear Clear  

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number