aspose file tools*
The moose likes Beginning Java and the fly likes Can any please advise me on how to run the java file using command prompt? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can any please advise me on how to run the java file using command prompt?" Watch "Can any please advise me on how to run the java file using command prompt?" New topic
Author

Can any please advise me on how to run the java file using command prompt?

Zubi Pen
Greenhorn

Joined: Oct 24, 2007
Posts: 26
I have a java file with the main method in it and need to run the file using ms dos. These
are the Enviroment Variables setting I have:

CLASSPATH C:\Program Files\Java\j2re1.4.2_12\lib\ext\QTJava.zip
QTJAVA C:\Program Files\Java\j2re1.4.2_12\lib\ext\QTJava.zip

All my java code is in the D:\project\student folder

Can any please advise me on how to run the java file using command prompt?

Thanks,
Zub
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
The Getting Started tutorial has some good examples. Follow Hello World to the Windows section for command line instructions. I made THIS to help someone with the next steps after that. Let us know if those help.
[ November 02, 2007: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14430
    
  23

C:\> d:
D:\> cd "project\student folder"
D:\project\student folder> java -classpath . MyProgram


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can any please advise me on how to run the java file using command prompt?