Running And compiling a java program,
November 7, 2008 at 12:49 AM
The bin directory is inside the jdk which you had just installed and which is required for compiling and running java programs. 'javac' and 'java' commands will only execute when you are inside the bin directory.So do one thing search for your jdk folder where it is installed , cut it and paste it under "C:\" directory(You can choose any other location as well but it is for simplicity). Now goto run, type cmd press enter. The dos-prompt console appears. Now type the command 'cd C:\jdk\bin' (inverted commas are not included in the command ). Now there you are inside the bin directory of jdk and now you can easily compile your program as: javac filename.java And to run the program afet succesfull compilation type: java filename.
I believe this post was useful for the beginners who were not able to compile their programs. For further doubts or queries you can mail me at firstname.lastname@example.org