javac not recognized java 7

前端 未结 3 543
有刺的猬
有刺的猬 2021-01-14 14:51

I have recently installed jdk7 on my windows vista. I have used default installation in C:\\Program Files\\Java\\jdk1.7.0_02\\ with javac stored i

3条回答
  •  别那么骄傲
    2021-01-14 15:20

    Do check properly in your path variables, you must have kept a space somewhere, else it must run. Do check properly, something is wrong while setting up path and classpath variables. Like for example, Your path variable already has something like say C:\Apache\bin\servlet-api.jar, now since you adding java to it you might have kept one space like

    C:\Apache\bin\servlet-api.jar; C:\Program_Files\Java\jdk1.7.0\bin
    

    you have to remove that space, and do it like this

    C:\Apache\bin\servlet-api.jar;C:\Program_Files\Java\jdk1.7.0\bin
    

    Do check properly, you must have left some space(gap) somewhere

    Example :

    Variable : JAVA_HOME
    Value : C:\Program_Files\Java\jdk1.7.0
    
    Variable : PATH
    Value : %JAVA_HOME%\bin
    

    Now open cmd, and type echo %JAVA_HOME% This must show your location to JAVA_HOME as set before.

    **EDIT : I have configured my PATH environmental variables (both for my user and system variables) with C:\Program_Files\Java\jdk1.7.0\bin and JAVA_HOME (as my user variable) with C:\Program_Files\Java\jdk1.7.0**

    ** But before that you are saying that your java is installed at this location**

    C:\Program Files\Java\jdk1.7.0_02\bin
    

    why this different location, you are setting it for jdk1.7.0 but you said it's inside jdk1.7.0_02.

    Hope that might help

    Regards

提交回复
热议问题