ElasticSearch和Java环境变量 [英] ElasticSearch and Java environment variable

查看:168
本文介绍了ElasticSearch和Java环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Windows 7,我已经在32位和64位版本中安装了JDK。所有四个安装的版本为8,更新20。
http://www.oracle.com/technetwork/java/当我下载并解压缩弹性搜索,并运行/bin/service.bat或/ bin / elasticsearch时,javase / downloads / jdk8-downloads-2133151.html



.bat文件,我进入我的终端:



必须设置JAVA_HOME环境变量!
按任意键继续。 。



当我做,终端关闭。



我已经卸载并重新安装,但没有修复它。为什么环境变量不会设置?这是一个安装的东西,或者我实际上必须手动设置变量。它似乎如果它正确安装,它将自动设置变量...请帮助。感谢



我已经使用这个手动设置了JAVA_HOME环境变量。



https://confluence.atlassian.com/display/DOC/Setting+the+JAVA_HOME+Variable+in+Windows



我的路径是 C:\Progra〜1\Java\jdk1.8.0_20\jre



现在,当我运行service.bat,终端在打开时立即关闭。
当我运行elasticsearch.bat,终端打印一些行,一段时间后,它只停留在那里,我不能打字。






编辑:



我卸载了所有的java,只重新安装了JRE 64位,并将系统环境变量设置为 JAVA_HOME 和`C:\Progra〜1\Java\jre1.8.0_20



我发现有 CLASSPATH ,设置为一个32位较旧的Java版本。我应该删除该变量吗?

解决方案

步骤1



您可以验证 JAVA_HOME 设置为 C:\Progra〜1\Java\jdk1.8.0_20

  C:\> echo%JAVA_HOME%

此外,验证 java 命令可用

  java -version 

参考



检查JAVA_HOME是否存在在使用批处理脚本的环境中



步骤2



如果 JAVA_HOME 未设置,请按照此处提供的步骤 - 如何设置Java首页在窗口中



摘要




  • 右键单击我的电脑图标,然后选择属性。

  • 单击高级选项卡。
    单击环境变量按钮。在系统变量下,单击新建

  • 输入变量名称为JAVA_HOME。

  • 输入变量值作为JDK的安装路径。



    (例如, C:\Progra〜1\Java\jdk1.8.0_20




  • 单击应用更改。


    • 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

      when I download and unzip elasticsearch, and run /bin/service.bat or /bin/elasticsearch.bat files, I get in my terminal:

      JAVA_HOME environment variable must be set! Press any key to continue . . .

      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

      I've manually set the JAVA_HOME environment variable using this.

      https://confluence.atlassian.com/display/DOC/Setting+the+JAVA_HOME+Variable+in+Windows

      My path is C:\Progra~1\Java\jdk1.8.0_20\jre

      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.


      EDIT:

      I uninstalled all java, reinstalled only the JRE 64 bit, and set the system environment variable to JAVA_HOME and `C:\Progra~1\Java\jre1.8.0_20

      I have discovered that there is CLASSPATH that's set to a 32bit, older java version. Should I delete that variable?

      解决方案

      STEP 1

      Can you verify JAVA_HOME is set to C:\Progra~1\Java\jdk1.8.0_20,

      C:\>echo %JAVA_HOME%
      

      Also, verify java command is available,

       java -version
      

      Reference

      Check if JAVA_HOME is present in environment using batch script

      STEP 2

      If JAVA_HOME is not set, please follow the steps provided here - How to Set Java Home in windows

      Summary ,

      • 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.

        (eg. C:\Progra~1\Java\jdk1.8.0_20).

      • Click OK.
      • Click Apply Changes.

      这篇关于ElasticSearch和Java环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆