Two Laptop Bag
The moose likes Beginning Java and the fly likes 'javac' is not recognized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark " Watch " New topic

'javac' is not recognized

Nikos Stavros
Ranch Hand

Joined: Feb 24, 2006
Posts: 243

when i try to compile from the command line the prompt says that javac is not recognized as an internal or external command, even though I can compile in eclipse.

Jesus lives
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Javac is a executable. You need it to be on your PATH, otherwise the operating system doesn't know where to look for it.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ajay Joseph

Joined: Nov 04, 2004
Posts: 21
When you run it in Command window you must set the path to the java where you have installed it.

if the Java in your system is jdk1.2.2(for eg) and is in D drive....

in the command window set path using this command

set path=D:\jdk1.2.2\bin

the bin path should be specified like this...

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15092

Read the installation notes for the JDK, especially step 5 (Update the PATH variable).

Follow the steps in Sun's Getting Started tutorial. It explains what the error means.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Nikos Stavros
Ranch Hand

Joined: Feb 24, 2006
Posts: 243

working fine now!
Bobby McFarlen

Joined: Jul 08, 2006
Posts: 1
thank you soooooo very much kind sir. me before this post: me now:
[ July 08, 2006: Message edited by: Bobby McFarlen ]
I agree. Here's the link:
subject: 'javac' is not recognized
It's not a secret anymore!