How to install Java


What is Java and why do I need?

Java is a programming language that allows programs to be written, which can then be run on more than one type of operating system. A program written in Java can run on Windows, UNIX, Linux, etc. as long as there is a Java Runtime Environment installed.

Some of the programs on this site is written in Java, so you must install the Java Runtime Environment to run them.

Where can I download Java?

You can download version 1.4 of Java http://java.sun.com/j2se/1.4/download.html. If you want to be able to write your own Java programs that can be compiled and run, then you should download the SDK (Software Developers Kit). If you want to be able to run a Java program that has already been compiled, you can get away with it just download the JRE (Java Runtime Environment). Once you have decided you should download the SDK or JRE. Choose the download that is most appropriate for your operating system.

Setting up Java

If you have not already installed Java, follow the instructions provided with the download to install Java.

Once Java is installed, you can run a Java program to run a Java program that was installed. You may find it convenient to add a file to the location of the operating system's PATH, otherwise you must explicitly refers to the absolute position of java.

Setting the path

Windows 2000/XP users can define their path by right-clicking "My Computer" and select "Properties". Under "Advanced" tab, there is a button that allows you to define the "Environment Variables". Click it and change the 'Path' variable so that it also contains the path to the executable Java. For example, if you have Java installed in C: \ JDK and your path is currently set to C: \ WINDOWS \ System32, and then you would change your path to read C: \ WINDOWS \ system32 C: \ JDK \ bin

When you open a new symbol, which reflects these changes and allow you to run Java programs, type "java". If you installed the SDK will also be able to run "javac" to compile things.

Windows 95/98/ME users may find that your PATH variable is stored in a different place. Edit the file c: \ autoexec.bat and add the following line to the end: SET PATH =% PATH% c: \ jdk \ bin

(This also requires that you have installed Java, C: \ jdk)

Linux, Unix, Solaris, FreeBSD user must set the PATH variable to indicate where the tracks were installed java. Discover the shell documentation if you have trouble doing so. For example, if you use bash as your shell, then add the following line at the end of you. Bashrc: export PATH = / path / to / java: $ PATH

Classpath

It 'also set up a route, you also need to tell Java where to find the compiled class files to run. You probably do not want to set the classpath to include at least the current working directory (.)

For example: SET CLASSPATH =% CLASSPATH%;.

The classpath may also contain other directories that contain compiled class files. Note that if you use classes that are contained in a file. Jar, specify the full path and file name in the classpath, not just the name of the directory that is inside.

Java Documentation

Alternatively, you can download the Java documentation, which contains the API pages that explain in detail how any good Java class can be used.