1. Create a folder, say "Java Programs" in C:\ drive
2. Open a simple text editor like notepad and save it as, say HelloWorld.java, in your created folder (Java Programs in my case) 3. Write the following program in it (and save)
4. Open the Start menu and click the Run command (or press Windows key + R). In the Open field type cmd. Click the OK button
5. Get to C:\ drive by typing cd\ at the command prompt. Next type cd Java Programs to get to the folder you've created. Now type dir at the command prompt and you'll see the HelloWorld.java file on display 6. Next compile the HelloWorld.java file using the javac tool (see JDKtools from the post below). Type javac HelloWorld.java at the command prompt. This compiler turns the HelloWorld.java source code into Java bytecode - HelloWorld.class
7. Now if you type dir again at the command prompt, you'll see a class file called HelloWorld.class already created (a Java bytecode) 8. Next we use the java interpreter, one of the main JDK tools (see the post below), to interpret the HelloWorld.class. Type java HelloWorld at the command prompt
Nota Bene: This write-up is about installing the JDK 6 in Windows Vista. JDK 7 is scheduled to be released on 28 July 2011. 1. Go tohttp://java.sun.com 2. ClickDownloads>Java SE 3. Select the latest version ofJava Platform, Standard Edition (say, JDK 6 Update 19)and download the JDK 4. Install the downloaded binary file (it could be something likejdk-6u19-windows-i586.exe) in theProgram Filesdirectory. Post installation, theJavafolder should showin theC:\Program Filesdirectory 5. Now click theStartbutton and open theStartmenu. In the right pane, right click onComputer>Properties>Advanced system settings
6. In theAdvancedtab, click theEnvironment Variables...button 7. Create a new user variable by clicking theNew...button 8. In theVariable namefield writePath 9. In theVariable valuefield writeC:\Program Files\Java\jdk 1.6.0_19\bin Now if you click Program Files > Java > jdk1.6.0_21 > bin, you'll find the following programming tools:
appletviewer: This tool lets you debug and run Java applets without a web browser java: This tool is the interpreter, the loader for Java applications javac: The compiler which converts source code into intermediate Java bytecode javadoc: The documentation generator in HTML format javah: The C header and stub generator for writing native methods javap: This tool is the disassembler which converts bytecode files into a program description ... ... 10. Open the Start menu and click the Run command (or press Windows key + R) 11. In the Open field type cmd 12. Click the OK button 13. At the command prompt type javac and press Enter