Forum Stats

  • 3,727,659 Users
  • 2,245,434 Discussions
  • 7,852,908 Comments

Discussions

java' is not recognized as an internal or external command, operable program or batch file.

Tony007
Tony007 Member Posts: 4,056 Bronze Trophy
edited November 2017 in New To Java

hi am having this error when setting java home this is what i have done am in window 7

C:\Users\userpc>java -versionError occurred during initialization of VMUnable to load native library: Can't find dependent librariesC:\Users\userpc>java -versionError occurred during initialization of VMUnable to load native library: Can't find dependent librarieC:\Users\userpc>set JAVA_HOME=C:\java6C:\Users\userpc>SET PATH=PATH%JAVA_HOME%\BIN;C:\Users\userpc>JAVA -VERSION'JAVA' is not recognized as an internal or external command,operable program or batch file.C:\Users\userpc>java -version'java' is not recognized as an internal or external command,operable program or batch file.

C:\Users\userpc>set JAVA_HOME=C:\java6C:\Users\userpc>SET PATH=PATH%JAVA_HOME%/BIN;C:\Users\userpc>java -version'java' is not recognized as an internal or external command,operable program or batch file.C:\Users\userpc>SET PATH=PATH%JAVA_HOME%;C:\Users\userpc>java -version'java' is not recognized as an internal or external command,operable program or batch file.

Answers

  • handat
    handat Member Posts: 4,688 Gold Crown
    edited November 2017

    First of all, is java actually installed under C:\java6 ?

    What does the following command show: DIR C:\java6\bin

  • Unknown
    edited November 2017
    hi am having this error when setting java home this is what i have done am in window 7. . .C:\Users\userpc>SET PATH=PATH%JAVA_HOME%\BIN;

    Well the OBVIOUS thing to do is to check that 'PATH' variable after you set it to see where you mistake is.

    One possibility is that the original PATH value does NOT end in a semicolon - which means you just added garbage to the end of it and destroyed whatever the last value was.

  • mNem
    mNem Member Posts: 1,380 Gold Trophy
    edited November 2017

    Shouldn't it be like

    >SET PATH=%PATH%;%JAVA_HOME%\BIN;

    >echo %PATH%

    or

    >c:\jdk6\bin\java -version

    edit:

    >c:\java6\bin\java -version

  • handat
    handat Member Posts: 4,688 Gold Crown
    edited November 2017

    Exactly, provided java is actually installed under C:\jdk6, or C:\java6

    That's why I was asking the OP to list their nominated location to verify that its the right location first before setting the JAVA_HOME and PATH

  • mNem
    mNem Member Posts: 1,380 Gold Trophy
    edited November 2017

    Hi,

    When I saw the highlighted portion from the original post in the reply from @rp0428, I noticed the prepended PATH variable wasn't delimited by  % on either side.That is what prompted me to reply.

    The jdk6 was in fact a typo and should read as java6 for OP's environment, judging from his settings).

    > C:\java6\bin\java -version

    Yes, your response has already covered it. Apologies for not paying attention to it.

This discussion has been closed.