Download Java program
- You can download java by clicking on this link easily. http://java.sun.com/j2se/1.4/download.html.
-
If you want to be able to write your own Java programs that you can compile and run then you must download the SDK (Software Developers Kit). If you just want to be able to run a Java program that has already been compiled, then you can get away with just downloading the JRE (Java Runtime Environment).
-
Once you have decided which you need, download either the SDK or the JRE. Choose the download that is most suitable for your operating system.
Install Java
If you are going to install java very first time please follow these instructions as given below.
- When you installed Java properly.
- After that you will be able to run Java program by running the java executable that was installed. You may find it convenient to add the location of this file to your operating system's path variable; otherwise you will need to explicitly refer to the absolute location of java
Setting up the java path on different operating systems
-
Set path on Windows 2000/XP: You can set path by right-click on 'My Computer' then selecting 'Properties'. Under the 'Advanced' tab, you can see here a button that allows you to set the 'Environment variables'. Just Click on this button and alter the 'Path' variable so that it also contains the path to the Java executable. For example, if you have installed Java in c:\jdk and your path is currently set to C:\WINDOWS\SYSTEM32, then you would change your path to read C:\WINDOWS\SYSTEM32;c:\jdk\bin
-
Set path on Windows 95/98/ME You can set path. Edit the c:\autoexec.bat file and add the following line at the end: SET PATH=%PATH%;c:\jdk\bin
(This also assumes that you have installed Java in c:\jdk)
-
Set path on Linux, UNIX, Solaris, FreeBSD You can set path variable to point to where the java binaries have been installed. Please refer to your shell documentation if you have trouble doing this. For example, if you use bash as your shell, then you would add the following line to the end of your .bashrc: export PATH=/path/to/java:$PATH
Setting up the java class-path
You also need to tell Java where to find compiled class files at runtime. You will probably want to set the class path to include at least the current working directory (.)
Eg: SET CLASSPATH=%CLASSPATH%;
The class path can also contain other directories that may contain compiled class files. Note that if you are using classes that are contained inside a .jar file, you will need to specify the full path and name of this file in the class path, rather than just the name of the directory it is contained within.
This article gives you the complete description that how to install java on different operating systems as given above in this section so by following these given instructions you can install java, set java path, java class path on different operating systems easily.
|
|