javac not recognized java 7

流过昼夜 提交于 2019-12-01 08:32:59

Open a command-line window, type "path" and check if "C:\Program Files\Java\jdk1.7.0_02\bin" is listed. If not try setting the path in that window (just to check if it works): "set path=C:\Program Files\Java\jdk1.7.0_02\bin\" and try running "javac" again.

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

You have an underscore in your entries that were put in the PATH variable. This will not work correctly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!