• Post Reply Bookmark Topic Watch Topic
  • New Topic

javac is not recognized  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am currently learning for my OCAJP exam.I am confused in the topic of creation and compilation of packages.
i have created two files-
C:\temp\packagea\ClassA.java
C:\temp\packageb\Class.java

During compilation i get an error message saying--'javac' is not recognized as an internal or external command,
operable program or batch file.

should i mention any specific path before compilation like we do for other programs?

What could be the possible errors i must check?


Thanks in advance.
 
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bhags lakshmi wrote:
During compilation i get an error message saying--'javac' is not recognized as an internal or external command,
operable program or batch file.


This is a Windows issue as it can't find the Java compiler. You need to setup your PATH correctly, or specify the path when running compiler.

Also, this may be a good place to start ... https://coderanch.com/wiki/659740/create-Java-program

Henry
 
Bhags lakshmi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the program


 
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem has nothing to do with your program, but with the fact that you did not add the bin directory of your JDK to the Windows PATH environment variable, as Henry explained. See the page that the link in his answer points to.
 
Sheriff
Posts: 4931
334
BSD
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Bhags lakshmi,

Probably you did not understand what Henry was saying to you.
Initial problem isn't part of the source code you are showing us.

Java compilers command isn't recognised in your command prompt yet, so you need to fix that. Fix is described in the link Henry provided too.
Once you go through there and do all steps, please let us know if you have more problems.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!