• Tidak ada hasil yang ditemukan

EENIE, MEENIE, MINEY MO

Dalam dokumen Beginning Programming with Java (Halaman 46-49)

“Compressed archive files ” in this chapter.

While you’re visiting

www.oracle.com/technetwork/java/javase/downloads , you can also download a copy of the Java API documentation. Look for a download labeled Java SE Documentation (or something like that).

Accept the license agreement, click the download link, and watch the file flow downward onto your computer’s hard drive. The downloaded file is a compressed .zip archive, so you can uncompress it the way you uncompress all other such archives.

(The uncompressed folder is a bunch of web pages. To start reading the Java API documentation, look in that folder for an index file or an index.html file. Double-click the file, and you’re on your way.)

For an introduction to the Java API documentation, refer to Chapter 1 .

Most people have no difficulties visiting the Oracle website

java.oracle.com and installing Java using the website’s menus. But if your situation is more “interesting” than most, you may have to make some decisions and perform some extra steps. The next few sections describe some of these “interesting” scenarios.

choose, start by trying the 32-bit version. (For more information about 32-bit systems and 64-bit systems, see the later sidebar “How many bits does your computer have? ”)

Java version number

The Java download page may have older and newer Java versions for you to choose from. You may see links to Java SE 7, Java SE 8, Java SE 9u4, and many others. (Numbering such as 9u4 stands for the fourth update to Java 9.) If you’re not sure which version

number you want, choosing the highest version number is probably safe. For additional help with the decision, consider these facts:

If you have Java 9 or higher, you’re okay.

If the only Java versions that you have are older than Java 7 (including Java 1.4.2, Java 5.0, and Java 6), your computer can run some but not all of the programs in this book.

If you have Java 7 or Java 8 but not Java 9, your computer can run all the programs in this book but you can’t run Java’s JShell tool. I introduce JShell in Chapter 6 . You can learn all about Java without ever running JShell. But JShell is handy and it’s fun to use.

The numbering of Java’s versions is really confusing. First comes Java 1.0, and then Java 1.1, and then Java 2 Standard Edition 1.2 (J2SE 1.2). Yes, the “Java 2” numbering overlaps partially with the “1.x” numbering. Next come versions 1.3 and 1.4. After version 1.4.1 comes version 1.4.2 (with

intermediate stops at versions like 1.4.1_02). After 1.4.2_06, the next version is version 1.5, which is also known as version 5.0. (That’s no misprint. Version 5.0 comes immediately after the 1.4 versions.)

The formal name for version 1.5 is Java 2 Platform, Standard Edition 5.0. And to make matters even worse, the next big release is Java Platform, Standard Edition 6 with the 2

removed from Java 2 and the .0 missing from 6.0. That’s what happens when a company lets marketing people call the shots.

Mercifully, from Java 6 onward, the version numbers settle into a predictable pattern. After Java 6 comes Java Platform, Standard Edition 7 and then Java Platform, Standard Edition 8 with updates such as 8u2 (Java 8, update 2). And starting with Java 9, there’s no longer such a thing as version 1.9. Now it’s plain old version 9.

JDK versus JRE

The download page offers you a choice between the JDK (Java Development Kit) and the JRE (Java Runtime Environment). The JDK download contains more stuff than the JRE download. The JRE includes a Java Virtual Machine and the application

programming interface. (Refer to Chapter 1 .) The JDK includes everything in the JRE, and in addition, the JDK includes a Java compiler. (Again, refer to Chapter 1 .)

The Eclipse IDE contains its own Java compiler. So you can

survive by downloading the smaller JRE (and avoiding the big JDK download). But I recommend downloading the entire JDK. Why?

Because you never know when another compiler (separate from Eclipse) will come in handy. Besides, the installation and

configuration of Eclipse on a Mac can be convoluted if you haven’t installed the full JDK. So, if you want to have a smooth ride,

download the JDK instead of the JRE.

By the way, another name for the JDK is the Java SDK — the Java Software Development Kit. Some people still use the SDK

acronym, even though the folks at Oracle don’t use it any more.

(Actually, the original name was the JDK. Later, Sun Microsystems changed it to the SDK. A few years after that, the captains of Java changed it back to the name JDK. This constant naming and

renaming drives me crazy as an author.)

Java SE, Java EE, and Java ME

While you wander around, you may notice links labeled Java EE or Java ME. If you know what these are, and you know you need them, by all means, download these goodies. But if you’re not sure, bypass both the Java EE and the Java ME links. Instead, follow links to the Java SE (Java Standard Edition).

The abbreviation Java EE stands for Java Enterprise Edition, and Java ME stands for Java Micro Edition. The Enterprise Edition has software for large businesses, and the Micro Edition has software for handheld devices. (Google’s Android software bears a passing resemblance to Java’s Micro Edition, but in many ways, Android and Java ME are very different animals.)

You don’t need the Java EE or the Java ME to run any of the examples in this book.

Additional Java-related software

You can download Java alone, or you can download Java with Oracle’s NetBeans IDE. You can download a collection of demos and samples. You can probably even download Java with fries and a soft drink. You can download plenty of extra stuff, but in truth, all you need is the Java JDK.

HOW MANY BITS DOES YOUR

Dalam dokumen Beginning Programming with Java (Halaman 46-49)