• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cant compile my java files on DOS  RSS feed

 
Taiwo Sokunbi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 5652
765
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Taiwo Sokunbi wrote:i have set my path variables.

Are you sure you did that correctly? Please go through this FAQ.
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch! I guess that with "DOS" you mean the Windows command prompt. Java doesn't run on MS-DOS.
 
Akhilesh Trivedi
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . but that sort of error message suggests you have got your PATH correct now.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everybody! I eventually got it through FAQ
 
Taiwo Sokunbi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ Jesper de Jong. Thanks, i changed the directory and it worked!
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done sorting it out
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!