Thursday, October 28, 2010

Executing Java Programs on CMD!!

Today most of the Java Building programs show output on a click, but it is really helpful to execute it on cmd. It helps you learn fast.
Type a  simple program in notepad and save it in the bin of the JDK(1.3 OR 1.6) as .java
Then goto cmd.
Type the directory of the bin.
Suppose it's in E. So type in e: or E:, press enter.
Then type the file location, jdk1.6\bin
Press Enter.
Then type....javac .java
Press Enter.
Then type java  Press Enter.Program should run.MAKE SURE THAT:The compiled file or .class file is in bin. If it does not work. Close CMD. Restart CMD again. Change drive to location to the bin and the type java (After Compliation).

No comments:

Post a Comment