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
501 views
in Technique[技术] by (71.8m points)

grails - "java -version" not working in command prompt

I downloaded this Java JDK and installed it.

But when I go to the command prompt to check the version, it says it's not recognized.

Is anyone else experiencing this issue with the latest Java?

I might not have installed the right version. I need the java that works with grails

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

C:>java -version
'java' is not recognized as an internal or external command,
operable program or batch file.

C:>

when i do a search on my computer for java, it does not find anything

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

Windows 2k8 R2 server- For both java [-option] or %JAVA_HOME% to work in the command line you need the following:

In Control Panel->System and Security->System->Advanced system setting->Advanced->Environment Variables->System Variables

Edit the Path variable and add a ";" after the last value and add the the path to the Java bin directory: e.g.- C:Progra~2Javajre6in

Add the JAVA_HOME Variable with the value set to the path for the java executable: e.g.- C:Progra~2Javajre6injava.exe


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

...