Programming

Programming intro
Java

Markup

First webpage guide
HTML
XHTML

Style & Layout

CSS

Browser scripting

Javascript
VBScript
AJAX

Server scripting

PHP
ASP

Making money online

Make money online

Installing and configuring Java

Before you can write and run Java programs, you have to install and configure Java first.

Two things will have to be installed:

  1. The Java Standard Development Kit

    You will need the Java Standard Development Kit to be able to write and compile Java programs.

  2. The Java Runtime Environment

    You will need the Java Runtime Environment to be able to run Java programs.

This tutorial focuses on:

Installing and configuring Java in Windows XP

  1. Download the Java SDK (Standard Development Kit) and JRE (both are bundled into one installer).

    Link: Java SDK and JRE
  2. Once you have downloaded the Java SDK and JRE, open the installation program.

    Note: The installation program works through the Windows installer, so if you have it disabled, the installer will not work. If you see that the installer is not working, then this is the most likely reason.

    In such a situation, to check if the Windows installer is enabled, do the following:

    • Go to Start -> Run -> Type services.msc -> and press Enter. You will now see the Windows Services window
    • Find a service named Windows Installer.

    • Right click on the Windows Installer service and choose Properties. In the properties window for the Windows Installer service, choose 'Automatic' as the Startup type.

    • Click 'Apply' then 'OK'

    • Close the Windows services window and try running the installer program again, if it still does not work, restart your computer and try running it then, as the computer might need to be restarted for the changes to take effect.
  3. Once you have the installation window open, follow the on screen instructions to install the Java SDK and JRE.

  4. Once you have the Java SDK and JRE installed, you will need to append the path where the Java programs for writing and compiling Java programs (javac.exe), as well as executing Java programs (java.exe) are located to the PATH variable so that you may be able to use them from any location on the computer.

    If you used the default location for installation, it should be drive_letter:\program files\Java\jdk1.6.0_02. So if you are using drive C, it would be C:\program files\Java\jdk1.6.0_02, if you are using drive F, it would be F:\program files\Java\jdk1.6.0_02, and so on.

  5. At this point, you should have the Java SDK and JRE installed and you should be able to write, compile, and run programs written in Java.

    • Right click on the 'My Computer' icon and choose properties.

    • Click on the 'Advanced' tab.

    • Click on the button that says 'Environment Variables'.

    • Scroll down where it says 'System Variables' until you see PATH.

    • Click on PATH, and then click the 'Edit' button.

    • For the field that says 'Variable Value', DO NOT erase the existing data. Instead append to the end of it a semicolon (;) followed by the path where the Java programs for writing and compiling Java programs (javac.exe), as well as executing Java programs (java.exe) are located so that you may be able to use them from any location on the computer.

      If you used the default location for installation, it should be drive_letter:\program files\Java\jdk1.6.0_02. So if you are using drive C, it would be C:\program files\Java\jdk1.6.0_02, if you are using drive F, it would be F:\program files\Java\jdk1.6.0_02, and so on.

      Once you append the data, click 'OK'. Click 'OK' on the Environment Variables window. Click 'OK' on the System Properties window.

    • At this point, Java should be installed, configured and ready to be used.

      To check if you can run javac.exe and java.exe from any location, open a new Command Prompt window by going to Start -> Run -> Type cmd -> and press Enter.

      Type 'javac' and press Enter. You should receive a list of options indicating that the javac tool is running.

      Type 'java' and press Enter. You should receive a list of options indicating that the java tool is running.

      NOTE: If you got a message saying that either javac or java is not recognized as an internal or external command, operable program or batch file, refer to steps #4 and #5.

Now that you have the Java SDK and JRE installed and configured, why not write your first Java program?

Installing and configuring Java in Linux

Coming soon.....

Step-by-step tutorials
Programming intro
HTML
XHTML
CSS
Javascript
Java

Practice

Online code editor
Practical examples
Practical exercises

Reference

Terms glossary
Reference material

Rate this site

Rate this site
Visitor comments