File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes 'java' is not recognized as an internal or external command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark " Watch " New topic

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

cybage cybagec

Joined: May 17, 2011
Posts: 2

I am new to java coding. I have installed jdk-6u25-windows-i586 in my machine. on executing it i am able to save two folders in my C drive
  • C:\Program Files\Java\jdk1.6.0_25

  • b)
  • C:\Program Files\Java\jre6

  • I have configured a new variable under user variables of Environment variables as Path : C:\Program Files\Java\jdk1.6.0_25\jre\lib;C:\Program Files\Java\jdk1.6.0_25;.;
    Also i have configured some System variables under Environment variables:

    1) CLASSPATH = C:\Program Files\Java\jdk1.6.0_25\jre\lib;C:\Program Files\Java\jdk1.6.0_25;.;
    2) JAVA HOME = C:\Program Files\Java\jdk1.6.0_25\bin
    3) PATH = "C:\Program Files\Java\jdk1.6.0_25\bin;C:\Program Files\Android\android-sdk\platform-tools;C:\Program Files\RSA SecurID Token Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;"

    When i write a small program in notepad with .javaextension and when i try to execute it by giving command javac <filename>.javai am getting warning as ''javac' is not recognized as an internal or external command,operable program or batch file.'

    when i try to execute any command, the same warning is shown with the particular prefix of what ever command i try to execute.

    Please help me out as early as possible.

    Thank you all in advance.
    Rob Spoor

    Joined: Oct 27, 2005
    Posts: 20279

    Remove the quotes in your PATH variable. They are not necessary there, and by wrapping the entire content in one single pair of quotes probably messes up more than it fixes.

    Oh, and your other variables aren't right either. JAVA_HOME should be set to C:\Program Files\Java\jdk1.6.0_25, without the bin folder. The CLASSPATH can be removed as these two folders should definitely not be on it.

    SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
    How To Ask Questions How To Answer Questions
    cybage cybagec

    Joined: May 17, 2011
    Posts: 2
    Thank you. Now i am able to execute it properly.
    I agree. Here's the link:
    subject: 'java' is not recognized as an internal or external command
    It's not a secret anymore!