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 Common Problems (and Their Solutions).

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.

When I go to a tutorial page that has an applet, the applet won't run because I don't have the right version of the Java software. Isn't Java Plug-in supposed to upgrade itself automatically? All the tutorial applets require Java SE 6. The software for this version of the platform is still in Beta, so Java Plug-in will not install it automatically. You need to install JRE 6 manually. Better yet, install JDK 6, so you can modify and extend the examples. Both are available for download on java.sun.com.

Why do the Tutorials use JDK 6 if that software is still in Beta? We're currently engaged in a major update of the Tutorials — the first comprehensive update of the Java SE Tutorials in several years. This requires a large commitment of resources, so we had to write content and examples for the latest version of the Java platform, Java SE 6. We also wanted to publicize the many new features of Java SE 6. These two factors made it important for us to write content and examples that referred to Java SE 6 and its reference implementation, JDK 6. This version of the software, though still in Beta, is extremely stable, and is a reliable development tool for tutorial-level users.

I'm just not ready to upgrade to JDK 6. Can I get the old Tutorials? You can get the old tutorials (and a lot of other stuff) from the Tutorials 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.

Downloading the examples one at a time is a pain. Is there a single download containing all the examples? That's also on the download page.

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 connect.apple.com. For more information about the Java platform on Mac OS X, go to developer.apple.com/java.

Complaints? Compliments? Suggestions? Give us your feedback.

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