Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
69 views
in Technique[技术] by (71.8m points)

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

When trying to check the current version of Java in which I am running, I received the error "java is not recognized as an internal or external command, operable program or batch file.".

I am running Windows 7 OS and have downloaded the latest JDK and felt I may have accidentally deleted the java from machine as before I was able to check the Java version using the command "java -version".

What software must I download to get Java working on my machine again?

EDIT:

I have managed to get Java running from my cmd again after ensuring all environment variables pointed to the current Java SDK.

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need to configure your environment variables, JAVA_HOME and PATH.

JAVA_HOME must contain the path to java, and you should add %JAVA_HOME%in to PATH

Alternatively, you can simply add to your PATH the whole path to the bin folder, without the JAVA_HOME variable, however, this makes a little more annoying when you need to have more than one java version on your machine (that way you only need to change JAVA_HOME and don't even bother with PATH)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...