0

"'javac' is not recognized as an internal or external command", How to fix this error? This is happened when I am going to run 'javac' command in terminal and I fixed Environment variable.

Environment Variable : Path :C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Users\HP\Desktop\jdk-12.0.2\bin

JAVA_HOME :C:\Users\HP\Desktop\jdk-12.0.2\bin

I have manages to fix the error by setting Environment variable . Thank you for all answers to my question.

Ridmi
  • 9
  • 3
  • What version of Java did you download? JRE or JDK? You need the JDK to be able to compile. – Tyler Mar 11 '20 at 01:08
  • I downloaded JDK. here is the my path - "C:\Users\HP\Desktop\jdk-12.0.2\bin" – Ridmi Mar 11 '20 at 01:28
  • Can you edit your Question to include your java_home and your path environment variable? Also include the full command you're running, from which directory you're running it and the result of the attempted run. – Scratte Mar 11 '20 at 01:43
  • Try changing the order of your `PATH`, so that your JDK is before the `Oracle\Java\javapath`. Also note that your `JAVA_HOME` is not suppose to include `\bin` (the `\bin` is important in the `PATH` though) – Scratte Mar 11 '20 at 02:06

2 Answers2

0

Check if your PATH variable contains a path to the bin/ folder containing javac of your installed JDK. Sometimes you also have to configure the JAVA_HOME env. variable. here is some help

If you work on windows then environment variables tend to not reload until system restart. To reload the variables you could restart the "Windows explorer" process in the task manager (that's a fast and easy hack if you add new env. variables).

Tooster
  • 322
  • 3
  • 14
0

open control panel -> system and security -> system -> advanced system settings(on the left)

then on the advanced tab you will find a button says Environment Variables

in the system variables section you will find "Path" choose it then click on edit

click on new and the path of the bin inside your jdk folder the path on my pc is(C:\Program Files\Java\jdk-13.0.1\bin)

Omar Hatem
  • 26
  • 4