I am getting error while doing 'play run'
"Could not execute the Java executable, please make sure the JAVA_HOME
environment variable is set properly (the Java executable should reside at JAVA_HOME/bin/java)."
But I can confirm that , JAVA_HOME
is set correctly, as I am able to run 'java' command from console ie DOS prompt.
Can anyone please guide me on this?
Set user variable JAVA_HOME to C:\\Progra~1\\Java\\jdk1.7.0_04
and
extend the system variable Path with %JAVA_HOME%\\bin;
works for me
I had the same problem on Windows 7. echo %JAVA_HOME%
returned C:\\Programmes\\Java\\jdk1.7.0
, which seemed correct. However, in Windows 7, even though path looks like that in explorer, the "real" path to use with cmd
is C:\\Program Files\\Java\\jdk1.7.0
.
I updated JAVA_HOME
and restarted cmd
— otherwise, the terminal wouldn't refresh its variables — and it worked smoothly.
如果您使用的是64位Windows版本,请确保同时安装了32位和64位Java版本(因此,程序文件和程序文件(x86)中都必须有Java目录。这就是我的问题。
I updated my jdk
from 1.6.0_14
to 1.7.0_10
and my jre6
to jre7
and had the same problem on XP. I then deleted JAVA_HOME
and added it again and it worked. I also added JRE_HOME
as a System Variable
JAVA_HOME --> C:\Program Files\Java\jdk1.7.0_10
JRE_HOME --> C:\Program Files\Java\jre7
Being able to run java from your command line does NOT indicate that you have set the JAVA_HOME variable. Do you know how to do that?? Or do you know how to check if this variable exist?
Here is a quick way IF you are using Windows: Right click My Computer (or Computer in Windows 7) then click the tab Advanced then environment variables. In the System variables check if there is an entry with the variable JAVA_HOME. If NOT create one (by clicking new) giving JAVA_HOME in variable name and the path of your jdk in the variable value. IF let's say, your jdk is installed on the following path: c:\\jdk6 in your pc THEN this should be your variable value. Click Ok, Ok again and then run your app again!
Have you done echo %JAVA_HOME%
?
Several issues:
JAVA_HOME
(a variable used by the JVM) is not the same than PATH
(a variable used by the OS to locate directories where to find executables). Doing java.exe
just shows that the bin directory of Java is in PATH, not that JAVA_HOME points where it should (or even it exists)
Also, Windows usually does not use the PATH
variable, but instead treats java specially and stores its location in the register (do an echo %PATH%
to check this).
In conclussion: You cannot assume JAVA_HOME
is set; check for it directly and set it (Control Panel-> System -> Advanced).
Make sure you use a DOS-Path in JAVA-Home. Meaning no fakes from Win-7 C:\\Programme in real C:\\Program Files and no blank in path.
C:\>dir /x Prog*
09.08.2011 13:55 <DIR> PROGRA~1 Program Files
21.08.2011 20:25 <DIR> PROGRA~2 Program Files (x86)
This is a safe solution.
echo %JAVA_HOME% is indeed always a good idea to.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.