ElasticSearch 和 Java 环境变量 [英] ElasticSearch and Java environment variable
问题描述
对于 Windows 7,我已经安装了 32 位和 64 位版本的 JDK.所有四个安装的版本都是 8,更新 20.http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
For Windows 7, I've installed JDK in both 32 and 64 bit versions. The versions are 8, update 20 for all four installations. http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
当我下载并解压缩 elasticsearch 并运行/bin/service.bat 或/bin/elasticsearch.bat 文件时,我进入了我的终端:
when I download and unzip elasticsearch, and run /bin/service.bat or /bin/elasticsearch.bat files, I get in my terminal:
JAVA_HOME 环境变量必须设置!按任意键继续 ...
当我这样做时,终端关闭.
When I do, the terminal closes.
我已经卸载并重新安装,但这并没有解决它.为什么不设置环境变量?这是安装问题,还是我实际上必须手动设置变量.看起来如果它安装正确,它会自动设置变量......请帮忙.谢谢
I've uninstalled and reinstalled, but that didn't fix it. Why wouldn't the environment varaible get set? Is it an installation thing, or do I actually have to manually set the variable. It just seems like if it installed correctly, it would set the variable automatically... Please help. Thanks
我已经使用它手动设置了 JAVA_HOME 环境变量.
I've manually set the JAVA_HOME environment variable using this.
https://confluence.atlassian.com/display/DOC/Setting+the+JAVA_HOME+变量+in+Windows
我的路径是C:Progra~1Javajdk1.8.0_20jre
现在,当我运行 service.bat 时,终端在打开时立即关闭.当我运行 elasticsearch.bat 时,终端会打印一些行,一段时间后,它就停留在那里,我无法输入任何内容.
Now, when I run service.bat, the terminal immediately closes upon opening. When I run elasticsearch.bat, the terminal prints some lines, and after a while, it just stays there, and I can't type anything.
我卸载了所有java,只重新安装了JRE 64位,并将系统环境变量设置为JAVA_HOME
和`C:Progra~1Javajre1.8.0_20
I uninstalled all java, reinstalled only the JRE 64 bit, and set the system environment variable to JAVA_HOME
and `C:Progra~1Javajre1.8.0_20
我发现有 CLASSPATH
设置为 32 位,较旧的 Java 版本.我应该删除那个变量吗?
I have discovered that there is CLASSPATH
that's set to a 32bit, older java version. Should I delete that variable?
推荐答案
STEP 1
您能否验证JAVA_HOME
是否设置为C:Progra~1Javajdk1.8.0_20
,
STEP 1
Can you verify JAVA_HOME
is set to C:Progra~1Javajdk1.8.0_20
,
C:>echo %JAVA_HOME%
另外,验证 java
命令是否可用,
Also, verify java
command is available,
java -version
参考
如果 JAVA_HOME
未设置,请按照此处提供的步骤操作 - 如何在windows中设置Java Home
If JAVA_HOME
is not set, please follow the steps provided here - How to Set Java Home in windows
总结、
- 右键单击桌面上的我的电脑图标,然后选择属性.
- 单击高级选项卡.点击环境变量按钮.在系统变量下,点击新建.
- 输入变量名作为 JAVA_HOME.
输入变量值作为 JDK 的安装路径.
- Right-click the My Computer icon on your desktop and select Properties.
- Click the Advanced tab. Click the Environment Variables button. Under System Variables, click New.
- Enter the variable name as JAVA_HOME.
Enter the variable value as the installation path for the JDK.
(例如C:Progra~1Javajdk1.8.0_20
).
这篇关于ElasticSearch 和 Java 环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!