Compiling and Running the Examples: FAQs

How do I compile and run the examples? For instructions, refer to The "Hello World!" Application lesson in the Getting Started trail. This lesson includes links to download the Java SE Development Kit 6 (also known as JDK™ 6) for Windows, Linux, Solaris, and Mac OS X. There are also instructions and links for the NetBeans™ IDE, which runs on all the above platforms.

Why do I get an error message when I try to compile or run an example? Check out Getting Started.

I already have the JRE. Why do I need the JDK? The Java SE Runtime Environment, or JRE, allows you to run programs that have already been compiled and deployed. We hope you will use the Tutorials to expand your understanding of Java technology by modifying and extending the examples. To do this, you need the JDK.

I'm just not ready to upgrade to JDK 6. Can I get the old Tutorials? You can get the old tutorials from the Java Technology Download page. But note that a lot of material in the old Tutorials is very out of date, even for version 5.0 of the platform. You can actually use the new Tutorials with JDK 5.0; just recompile the examples. Most of the current examples will recompile without change; the rest will recompile with minor changes.

Why doesn't Sun provide software for Mac OS X?. Java platform software for Macintosh OS X is maintained by Apple Computer; the OS X version of JDK 5.0 is included with the OS. Apple also provides JDK 6 as Beta software; to download it, go to For more information about the Java platform on Mac OS X, go to

Complaints? Compliments? Suggestions? Give us your feedback.

Copyright 1995-2007 Sun Microsystems, Inc. All rights reserved.