ElasticSearch and Java environment variable

前端 未结 10 1073
抹茶落季
抹茶落季 2020-12-28 12:38

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/d

相关标签:
10条回答
  • 2020-12-28 13:37

    You can set the system-wide environment variables by clicking Start, pointing to 'Computer', right-clicking and selecting properties. Next, click 'Advanced System Settings', hitting the 'Advanced' tab and selecting the 'Environment Variables' button. This brings up a window where you can set your JAVA_HOME variable. You can do this either for the current user (top box) or system-wide.

    Environment variables dialog

    After doing this, open a new cmd window (Start menu, type 'cmd' and hit enter) and verify JAVA_HOME is set like in the question above.

    0 讨论(0)
  • 2020-12-28 13:38

    I was facing similar issue where Java home is already set but still it was throwing error. Open elasticsearch-plugin.bat file and change "IF DEFINED JAVA_HOME" to "IF DEFINED %JAVA_HOME%" , if you have java home already set.

    Thanks

    0 讨论(0)
  • 2020-12-28 13:41

    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.
    0 讨论(0)
  • 2020-12-28 13:43

    I get this error because I was using Powershell and it wasn't seeing environment variable. (I don't know way) Then I used CMD and it ran successfully.

    0 讨论(0)
提交回复
热议问题