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

'javac' is not recognized as an internal or external command

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added the Path to the JDK in Advanced settings and rebooted my system. The Command Prompt recognizes my version of java but not javac.

I am running Windows 7 64bit OS and JDK 1.8.0_91
Please Help, Thank you
 
Rancher
Posts: 181
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you set your environmental variables in System Properties? Sometimes you need to do that
(Control Panel -> System -> Advanced System Settings)
 
Marshal
Posts: 69799
277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Are you sure you are recognising the 8u91 version? Try the following two instructions:-
java -version
javac -version
The error message you are getting is very common, and ZG has already explained it. We have an FAQ which covers it. The Java™ Tutorials have a section which covers the same problem.
 
Marshal
Posts: 25676
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your installation includes java.exe but not javac.exe then perhaps you only installed a JRE (Java Runtime Environment) instead of a JDK (Java Development Kit). Or perhaps you set your PATH variable to point to the JRE part of your installation. Have a look at the folder where your PATH points to and see if it has java but not javac. On my machine which is very similar to yours (at least the bit you described) my PATH points to C:\Program Data\Oracle\Java\javapath, among other things. When I install new versions of Java I never have to change anything. So perhaps your PATH has that at the beginning and you added something else at the end?

And, welcome to the Ranch!
 
Cherokee Nelson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Environmental variables have been set- The PATH to JDK has been added and a reboot has occurred.
In Command Prompt I entered java -version and received recognition for
java version "1.5.0_91", Java SE Runtime Environment (build 1.8.0_91-b14), and Java Hotspot 64bit Server (build 25.91-b140
I read the facts page and did not see a solution I have not attempted
javac.exe is in the bin folder of the PATH i designated
Do I for some strange reason have to designate a path directly to the bin folder of JDK to access the compiler?
And thank you for the timely replies and the welcome
 
Cherokee Nelson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
To answer the replies in order
1) Environmental variables have been set- The PATH to JDK has been added and a reboot has occurred.
2) In Command Prompt I entered java -version and received recognition for:
java version "1.5.0_91"
Java SE Runtime Environment (build 1.8.0_91-b14),
Java Hotspot 64bit Server (build 25.91-b140
I read the facts page and did not see a solution I have not attempted
3) javac.exe is in the bin folder of the PATH I designated
Do I for some strange reason have to designate a path directly to the bin folder of JDK to access the compiler?
I will look at the FAQ's page again to see if there is anyhting I may have missed.
And thank you for the timely replies and the welcome
 
Paul Clapham
Marshal
Posts: 25676
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you were typing on a numeric keypad, because you typed "1.5.0" instead of "1.8.0" there. Confused me for a few seconds before I figured out what you must have done.

Anyway could you copy your PATH variable and post it here?
 
Cherokee Nelson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are my Path Variables

C:\Program Files\Java\jdk1.8.0_91\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Windows Live\Shared\

 
Campbell Ritchie
Marshal
Posts: 69799
277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The output with 1.8.0_91 etc looks correct for the java tool, and that PATH looks correct too. Please copy and paste such output to save time and prevent such typos: instructions here. Yes, the Java® PATH entry usually starts with the drive letter (on Windows®) and ends bin.
To confirm you have it working try
javac -version
and try to compile a file.
 
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic