View Feed
Java Developers
Community of Java Developers: Get Java Programming Help from fellow Java Developers across the world.
654 Members
Join this group to post and comment.
Rits rishi
Rits rishi • May 21, 2012

how to run a java file using command prompt?

guys plz tell me the answer...
First you need to compile the java program by using the following command
javac filename
for executing below command is used
java classname
if u r java file name and classname is Demo
for compiling javac
for executing java Demo
Note: before that you need to set class path
kamba giri
kamba giri • May 23, 2012
first of all you need to set class path in environment variables
1.goto my computer-> system properties -> advanced system settings -> environment variables.
2. in the environment variables menu in the first box you need to set the path of the java i.e., jdk path
ex:- .;C:\Program Files (x86)\Java\jdk1.6.0\bin;
and then okk..
3. now you can compile and execute the java program as mentioned by nareshkumar..

Share this content on your social channels -