Java Tutorial/Installing Java
From Wikiversity
The first thing you need to do in learning Java is to install the software needed to develop and run Java programs. To be able to run Java programs on your home computer, you will need the Java Runtime Environment (JRE). Command-line development tools (compilers, etc.) can be found in the Java Development Kit (JDK).
Both the JRE and the JDK can be downloaded at here. However before you download, its worth noting that it is unnecessary to download both the JRE and the JDK. If you want to develop Java programs (which you want to do), the JDK bundles JRE along so all you need to download is the JDK. Other downloads such as patches, source code, and documentation can also be found at the link I have mentioned.
| Software Prerequisites | |
|---|---|
| Name | Description |
| Java Runtime Environment (JRE) | Allows users to run Java programs/applets; unnecessary if downloading the JDK |
| Java Development Kit (JDK) | Contains development tools e.g compilers, etc; also bundles JRE |
If you are going to download the JDK, you should notice that there are two choices to choose from. One of the choices has just the JDK while the other, in addition the JDK, includes the NetBeans IDE. Before you choose whether or not you want to have the NetBeans IDE, you should read into the next section, Choosing the right text editor.
After installing Java, you may need to do a little fiddling with environment variables on your computer before you can conveniently use the tools you just installed. Note that detailed installation notes for a variety of platforms can be found at the Java hompage (these steps only cover the Windows operating system). You need to set two Environment variables namely PATH(an environment variable used by the Windows to locate executable files) and CLASSPATH(an environment variable used by the Java Virtual Machine and Java technology-based applications to locate .class files).
The first step is to go to Start and right-click My Computer and then Properties. Now go to the Advanced tab and click on Environment Variables. In the User variables list-box, double-click PATH (if there is one). If there is not a variable named PATH, click New and enter in PATH as the variable name. Now as for the variable value, type in the directory in which you installed Java in followed by a semi-colon. Make sure the directory you enter in contains the tools you will be using (it should end in \bin).
An example of the environment variable would be:
C:\Program Files\Java\jdk1.6.0\bin; other environment variables
Similarly set(or create if it is not already present) the Classpath variable with the directory name you choose to store your program (.class) files.
| Previous: | [[Java Tutorial/|]] | Up: | Java Tutorial | Next: | Choosing the right text editor |
|---|