0

I am new to java programming language. First i download the sdk and install it in to my pc. Then i add a new environment variable like this

  path C:\Program Files\Java\jdk1.6.0_29\bin 

After creating this i entered javac in my cmd prompt. But i didn't get any thing.

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

i am look in to some tutorials they said this way for setting path. if any one know about this please help me.

5
  • you need not create a new "Path " variable..add the location of JDK\bin to existing Path variable under System variables.. Restart cmd prompt and type javac (PS: ";" is the seperator used. Commented Jan 10, 2014 at 11:16
  • Once you set the path, your computer need to be restarted to reflect those changes.Did you do that ? Commented Jan 10, 2014 at 11:21
  • 2
    @RadhamaniMuthusamy - No.. Computer should not be restarted.. restart only the cmd prompt.. Commented Jan 10, 2014 at 11:21
  • To set an environment variable in a command window you use the set command. For example set path="C:\Program Files\Java\jdk1.6.0_29\bin". The quotes are important because of the space in the directory name Program Files. However, as others have suggested, it's better to modify the system's path environment variable. Commented Jan 10, 2014 at 11:21
  • yes. i didn't restart the cmd prompt. After restart this working perfect. thanks Commented Jan 10, 2014 at 11:23

4 Answers 4

3
  1. Right click My Computer -> Advance Options -> Environment Varibles -> Under User Variables
  2. Click New
  3. Under Variable name type JAVA_HOME
  4. Under Variable value type C:\Program Files\Java\jdk (without bin)
  5. Click OK
  6. Again Click New
  7. Under Variable name type PATH
  8. Under Variable value type %JAVA_HOME%\bin
  9. Click OK
Sign up to request clarification or add additional context in comments.

Comments

1
1. Right click My Computer->Advence Option->Environment Varibles->SystemVariables 
2. variable : Path->Edit
3. Copy your jdk bin directory i.e. C:\Program Files\Java\jdk1.6.0_29\bin
4. Paste it after putting a semi-colon(;) in value section 

To test it..Open cmd with administrator and type java -version

Comments

0

Follow this Step for Windows for Permanent Path setup:

    1) My Computer Properties

    2) Advanced Option

    3) Environment Variable

    4) New tab

    5) Name= Path

    6) Value = C:\Program Files\Java\jdk1.6.0_29\bin 

    7) Ok

EDIT

See that you are into c:\Windows\System32 and your admin That's IT now type javac and its DONE

Comments

0

Assuming your jdk is installed in c:\Program Files\java\jdk directory

EDIT "Path" system variable which would be --> C:\WINDOWS\SYSTEM32

To --> C:\WINDOWS\SYSTEM32;c:\Program Files\java\jdk\bin

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.