Setting Up a Java Programming Environmentc


Java™ 2 Primer Plus
By Steven Haines, Steve Potts

Table of Contents
Chapter 1.  Introduction to Java

Setting Up a Java Programming Environment

Before you can compile and execute a Java application, you must setup a Java programming environment. There are various Java compilers, but the standard is the one distributed on the Sun Web site. You can download the Java 2 SDK, Standard Edition from

On this page you will see three types of downloads for the latest released version and latest prereleased/release candidate (if available) version of Java. These three downloads are

  • Software Developers Kit (SDK)

  • Java Runtime Engine (JRE)

  • Documentation

The SDK is used to compile and execute Java programs; you will need to download this.

The JRE is used to execute Java programs, but does not contain anything for compiling them. People that use your Java applications will have to download and install JRE; the SDK includes the JRE so you don't need to download it.

The documentation is specifically for users of the SDK. It lists and explains all the public classes in Java. I would highly recommend that you download and install this (it is viewable directly from the Internet). If you are short on disk space, then you can browse through the documentation as you need it.

As of this writing, the latest version of the Java 2, Standard Edition is version 1.4.

There are links to installation instructions presented to you when you download the SDK, but the following sections summarize the installation steps.

Microsoft Windows

The Java SDK for Microsoft Windows is an InstallShield­® file that guides you through the installation using wizard-like screens.

  1. Download the SDK.

  2. Launch the downloaded file.

  3. Follow the prompts.


There are two versions of installation for Linux: a self-extracting binary file, and a binary file containing RPM packages.

Self-Extracting Binary
  1. Download the SDK.

  2. Copy the file to the directory where you want to install Java.

  3. Grant the file execute privileges:

     chmod a+x filename.bin 

  4. Execute the file:


  5. Follow the onscreen instructions.


RPM files, which are primarily used on Red Hat Linux, contain detailed installation instructions. RPM files are very easy to install and require little user interaction.

  1. Download the SDK.

  2. Grant the file execute privileges:

     chmod a+x filename.rpm.bin 

  3. Execute the file:


  4. The result of this execution is the creation of a .rpm file. Execute the .rpm file as follows:

     rpm -iv filename.rpm 


    Java 2 Primer Plus
    Java 2 Primer Plus
    ISBN: 0672324156
    EAN: 2147483647
    Year: 2001
    Pages: 332

    Similar book on Amazon © 2008-2017.
    If you may any questions please contact us: