How to change JAVA.HOME for Eclipse/ANT

前端 未结 10 1895
星月不相逢
星月不相逢 2020-12-04 17:36

I am trying to sign a jar file using an ANT script. I know this has to be pointed at the JDK directory for jarsigner.exe to run, but when I echo java.home it re

10条回答
  •  庸人自扰
    2020-12-04 18:11

    Go to Environment variable and add

    JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_37
    

    till jdk path (exclude bin folder)
    now set JAVA_HOME into path as PATH=%JAVA_HOME%\bin;
    This will set java path to all the applications which are using java.

    For ANT use,

    ANT_HOME=C:\Program Files (x86)\apache-ant-1.8.2\bin;
    

    and include ANT_HOME into PATH, so path will look like PATH=%JAVA_HOME%\bin;%ANT_HOME%;

提交回复
热议问题