When I first decided to learn Java all alone, the first major setback I faced was how to setup the java compiler in Windows 7 (same for windows vista). Most of the search I did gave confusing description and were based on Windows XP which is kind of history now.
For guys who are new to Windows Vista and 7 following is the detailed description of setting up your java compiler:
- Download the Java Development Kit (JDK). You can download it here.
- Follow the instructions and install the JDK.
- Right-click the Computer icon on your desktop or start menu, click on properties.
- Click on Advanced system settings. A dialog box appears.
- Click on the Environment Variables button at the bottom-right of the System Properties dialog box.
- A dialog box named Environment Variables appears. Click on the TEMP variable in the User variables section. Now go down to the “Path” variable in the System Variables section and click on edit.
- The Edit System Variable dialog appears. At the end of the Variable value section append a semi-colon and then enter the path of the bin directory of you JDK. To copy the path of the bin directory follow the picture below
- Then paste the path on the field as shown below. Make sure you have appended a semi-colon before you paste the address.
- Then click on OK as shown and then you are done. To confirm whether your settings are right, open command prompt and type “javac”. You should get a response like this on your prompt.
- Type ”java” and you should get something like this.
If all of the above steps are followed correctly, you will be able to setup your java compiler and you can now start programming.
P.S.: I recommend you to use textpad instead of the usual command line interface to do your java programs. Its a freeware although it will ask you to register it.