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

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: 4885
60
  • 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".
 
Climb the rope! CLIMB THE ROPE! You too tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic