Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Can not compile java files from the command prompt.

 
Ranch Hand
Posts: 130
2
  • Mark post as helpful
  • send pies
  • 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: 4450
41
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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".
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic