Error in setting JAVA_HOME

前端 未结 7 2253
庸人自扰
庸人自扰 2020-12-03 07:20

I have recently downloaded Maven and followed the instructions given on this this page. I already have ant installed on my machine. Now, if I want to verify that Maven is in

相关标签:
7条回答
  • 2020-12-03 07:45

    You are pointing your JAVA_HOME to the JRE which is the Java Runtime Environment. The runtime environment doesn't have a java compiler in its bin folder. You should download the JDK which is the Java Development Kit. Once you've installed that, you can see in your bin folder that there's a file called javac.exe. That's your compiler.

    0 讨论(0)
  • 2020-12-03 07:48

    The JAVA_HOME should point to the JDK home rather than the JRE home if you are going to be compiling stuff, likewise - I would try and install the JDK in a directory that doesn't include a space. Even if this is not your problem now, it can cause problems in the future!

    0 讨论(0)
  • 2020-12-03 07:53

    JAVA_HOME should point to jdk directory and not to jre directory. Also JAVA_HOME should point to the home jdk directory and not to jdk/bin directory.

    Assuming that you have JDK installed in your program files directory then you need to set the JAVA_HOME like this:

    JAVA_HOME="C:\Program Files\Java\jdkxxx"
    

    xxx is the jdk version

    Follow this link to learn more about setting JAVA_HOME:

    http://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/index.html

    0 讨论(0)
  • 2020-12-03 07:57

    Do not include bin in your JAVA_HOME env variable

    0 讨论(0)
  • 2020-12-03 07:59

    Follow the instruction in here.

    JAVA_HOMEshould be like this

    JAVA_HOME=C:\Program Files\Java\jdk1.7.0_07
    
    0 讨论(0)
  • 2020-12-03 08:01

    JAVA_HOME = C:\Program Files\Java\jdk(JDK version number)

    Example: C:\Program Files\Java\jdk-10

    And then restart you command prompt it works.

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