| Author |
Cant compile my java files on DOS
|
Taiwo Sokunbi
Greenhorn
Joined: Feb 01, 2012
Posts: 4
|
|
|
please i need help regard running java on DOS. Whenever i try to compile it say "javac is not recognized as an internal or external command, operable programor batch file". i have set my path variables.
|
 |
Devaka Cooray
Saloon Keeper
Joined: Jul 29, 2008
Posts: 2595
|
|
Taiwo Sokunbi wrote:i have set my path variables.
Are you sure you did that correctly? Please go through this FAQ.
|
Author of ExamLab - the free mock exam kit for SCJP / OCPJP
Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 26720
|
|
Welcome to the Ranch
Did you reopen your command line after setting the PATH? You might need to reboot your computer if using DOS.
If that doesn’t help, please show us exactly what you have done, including your PATH.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 11642
|
|
|
Welcome to the Ranch! I guess that with "DOS" you mean the Windows command prompt. Java doesn't run on MS-DOS.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Akhilesh Trivedi
Ranch Hand
Joined: Jun 22, 2005
Posts: 1351
|
|
Jesper de Jong wrote:Welcome to the Ranch! I guess that with "DOS" you mean the Windows command prompt. Java doesn't run on MS-DOS.
Do you mean we have JRE for Windows and not for DOS?
|
Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 11642
|
|
Akhilesh Trivedi wrote:Do you mean we have JRE for Windows and not for DOS?
Yes indeed, but nobody seriously uses MS-DOS anymore.
|
 |
Taiwo Sokunbi
Greenhorn
Joined: Feb 01, 2012
Posts: 4
|
|
sorry! i meant command prompt. i have tried to set the class path again but its bringing another error.
javac: file not found: myjavafilename
Usage:javac<Options><source files>
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 26720
|
|
|
Go back and delete the classpath you set. Lots of people advise you to set a system classpath, but it usually causes more harm than good.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 26720
|
|
|
. . . but that sort of error message suggests you have got your PATH correct now.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 11642
|
|
Taiwo Sokunbi wrote:i have tried to set the class path again but its bringing another error.
javac: file not found: myjavafilename
Are you in the directory that contains the source file? If not, then go there with the cd (current directory) command. Are you sure you are typing the name of your Java source file correctly?
|
 |
Taiwo Sokunbi
Greenhorn
Joined: Feb 01, 2012
Posts: 4
|
|
Thanks everybody! I eventually got it through FAQ
|
 |
Taiwo Sokunbi
Greenhorn
Joined: Feb 01, 2012
Posts: 4
|
|
|
@ Jesper de Jong. Thanks, i changed the directory and it worked!
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 26720
|
|
Well done sorting it out
|
 |
 |
|
|
subject: Cant compile my java files on DOS
|
|
|