• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to fix the error Javac is not recognised as an internal or external command

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have windows vista operating system. I downloaded Java version6 update 5. When I compile a java program I get the error javac is not recognised an internal or external command.

[ April 15, 2008: Message edited by: deepa karra ]
[ April 15, 2008: Message edited by: deepa karra ]
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are you trying to download the JRE or the JDK? and why can't you download it - is the site down, do you not have enough space on your hard drive, do you not know where to go to get it, or do you not know what to download?

are you trying to set the classpath, or the path? there is no such thing as 'class path'.

The more specific your question, the easier it is to help you.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

First, what do you mean by "not able to download Java"? What exactly is happening when you try?

Second, why are you trying to set the CLASSPATH? (Especially if you were not able to download Java.) You should be updating the PATH, but you should probably not be setting a CLASSPATH.

When you download JDK 6 Update 5, be sure to follow the installation instructions, which will tell you how to update the PATH variable.
 
marc weber
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by deepa karra:
I have windows vista operating system. I downloaded Java version6 update 5. When I compile a java program I get the error javac is not recognised an internal or external command...


This is because the PATH is not updated. See the link to the installation instructions I posted above. Step 4 addresses this.
[ April 15, 2008: Message edited by: marc weber ]
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok it is a very common thing that beginners experience... All you need to do is set the proper path and also your classpath

you can do this from your command line as follows

set path =%PATH%;"C:\Program Files\Java\Jdk\bin....."

and also please do not forget to add the same to your environment variables.
 
marc weber
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Govind SrinivasaRaghavan:
...and also your classpath...


Please do not set a CLASSPATH.

Follow the instructions linked to above for updating the PATH.
 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry that i mentioned about class path...You need to just set your path
 
fred rosenberger
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Govind SrinivasaRaghavan:
sorry that i mentioned about class path...You need to just set your path

There is no such thing as a "class path". there is a "path" and a "classpath". the latter should not be set (for beginners).
 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yup...i just wanted to say path and i probably messes it up in my earlier post...and i indeed know it is "classpath", the space was unintentional

apologies all around

Sorry for the typographical error in my last rely
 
deepa karra
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I clicked on mycomputer->properties->advanced systemsettings->environment variables->path

I've set the path as c:\programfiles\java\jdk1.6.0_05\bin;

I save my java program in c:\javaex
In the commandprompt, I typed cd c:\javaex
when I compiled the program using javac hello.java,
i got the error javac not an internal or external command
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The most common mistake is that after you set the PATH, you forgot to exit the shell. Open a new shell afterwards and the changes should be reflected in the newly open shell.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have set the PATH in environment variables as follows. Just replace it with the version you are using.Do not forget to include the double quotation mark (" ")as shown below.It is a common mistake.

PATH="C:\Program Files\Java\jdk1.5.0_08\bin";%PATH%

Prashant.
 
deepa karra
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am still unable to fix the error..
When i looked in c:\java I found three more folders jre1.6_01,jre1.6_02,jre1.6_03
I didnot find Jdk there. I am totally confused about the installation and setting the path.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check Fred's first question: "are you trying to download the JRE or the JDK"

Which have you installed? Check "Manage Programs" (I think that is what it is called in Vista - I may be wrong) in Control Panels to see what you have installed.
 
Prashant Poman
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As you are telling that you have only JRE , now try to download JDKJDK 6 Downloadfrom here
 
deepa karra
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah...finally i got it...
Thanks everybody!!
 
reply
    Bookmark Topic Watch Topic
  • New Topic