Running Java Code from Command Prompt

To run java you must install JDK. If you dont have it download it from :

http://www.oracle.com/technetwork/java/javase/downloads/

 

Setting Enviroment Variables:

     Right Click Computer

     Click Advanced System Settings under properties

     Click New  under Enviroment Variables

     Set “path” as Variable name

     For Variable value you need to go to the folder where you installed JDK

     Inside JDK installation directory open subdirectory bin

     Right Click any file inside that directory Under properties

     Copy the address of the file that address is Actually the Variable value of variable path press “ok”

   Check:

           Open Command Prompt  and type  “javac” alot of crap will show up. This is the indication that you’re ready to go!

           In Command Prompt change your current directory to the directory in which u saved the file which u want to run

           type “java FileName” ‘java ‘ is the command to execute the java code “FileName” is the name of .class file.

                                                               🙂     ENJOY!!!!!

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s