Macintosh : Java Glossary

go to home page M words local find full screen, hide local find menu Google search web for more information on this topic jump to foot of page translate this page with Babelfish 2008-08-21 by Roedy Green ©1996-2008 Canadian Mind Products
index page for letter ⇒ punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
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 PowerPC RISC CPU. All the currently manufactured Macintoshes now use Intel CPUs, 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. Version 1.6 is available only for the new 64-bit Intel-based Macs running Leopard (OS X 10.5). Snow Leopard is the preview of the next release of OS X. Apple supplies the JVM, not Sun. Last revised: 2008-08-20

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 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 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 (Webstart) apps, and applets launched via Webstart. It also changes the default compiler version and JRE libraries used at compilation

The Apple JDK 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) 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 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
Key
Legend
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  

CMP homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.62] Spread the Net
You are visitor number 6,207.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/macintosh.html J:\mindprod\jgloss\macintosh.html