• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can not compile java files from the command prompt.

 
Ranch Hand
Posts: 130
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friends, I have been using IDE's to write, compile and run my java source code files,
But when I try to compile using this command "javac" from my windows command prompt
I get this error "javac is not a recognized as an internal or external command, operable program or batch file."
but the java -version and the java command runs with no issue.
Please how can I resolve this issue..............
All contributions are highly welcomed
Thank you.
JavaRanchCapture3.PNG
[Thumbnail for JavaRanchCapture3.PNG]
A command line output of the concern issue
 
Enthuware Software Support
Posts: 4810
52
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This means you have installed JRE and not the JDK. Or the JDK's bin is not in the PATH. This should help: http://www.javatpoint.com/how-to-set-path-in-java if you have JDK installed already.

If not, just download the JDK from Oracle and install it first.

HTH,
Paul.
 
Kelvin Okornoe
Ranch Hand
Posts: 130
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Anilprem wrote:This means you have installed JRE and not the JDK. Or the JDK's bin is not in the PATH. This should help: http://www.javatpoint.com/how-to-set-path-in-java if you have JDK installed already.

If not, just download the JDK from Oracle and install it first.

HTH,
Paul.



Thank you, I have installed the JDK, So I will try out setting the path environment to see.
 
Kelvin Okornoe
Ranch Hand
Posts: 130
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Anilprem wrote:This means you have installed JRE and not the JDK. Or the JDK's bin is not in the PATH. This should help: http://www.javatpoint.com/how-to-set-path-in-java if you have JDK installed already.

If not, just download the JDK from Oracle and install it first.

HTH,
Paul.



I was able to set the PATH for the JDK and I can run the javac command now without issue, but there is a bit of a  problem, anytime I try to compile my java class I get this error message.
Capture4.PNG
[Thumbnail for Capture4.PNG]
 
Kelvin Okornoe
Ranch Hand
Posts: 130
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kelvin Okornoe wrote:

Paul Anilprem wrote:This means you have installed JRE and not the JDK. Or the JDK's bin is not in the PATH. This should help: http://www.javatpoint.com/how-to-set-path-in-java if you have JDK installed already.

If not, just download the JDK from Oracle and install it first.

HTH,
Paul.



I was able to set the PATH for the JDK and I can run the javac command now without issue, but there is a bit of a  problem, anytime I try to compile my java class I get this error message.



Sorry guys, I have realized where the error is coming from, I forgot to add the java extension, As in "javac Mutant.java".
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic