• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Cant compile my java files on DOS

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 6914
1314
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 75715
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 75715
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 75715
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
. . . but that sort of error message suggests you have got your PATH correct now.
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everybody! I eventually got it through FAQ
 
Taiwo Sokunbi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@ Jesper de Jong. Thanks, i changed the directory and it worked!
 
Campbell Ritchie
Marshal
Posts: 75715
354
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well done sorting it out
 
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic