File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark " Watch " New topic
Author

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

cybage cybagec
Greenhorn

Joined: May 17, 2011
Posts: 2
Hello,

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
a)
  • 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
    Sheriff

    Joined: Oct 27, 2005
    Posts: 19654
        
      18

    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
    How To Ask Questions How To Answer Questions
    cybage cybagec
    Greenhorn

    Joined: May 17, 2011
    Posts: 2
    Thank you. Now i am able to execute it properly.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: 'java' is not recognized as an internal or external command
     
    Similar Threads
    problem calling a remote webservice [ Algo Error]
    Compiler Not Found, Despite Installing JDK
    ant not recognized...
    Wrong version appearing for "java" command
    can't compile .java file