Environmental variables in ant script not working

后端 未结 3 1999
灰色年华
灰色年华 2021-02-05 18:06

I\'m trying to set up a machine-independent build environment for a Spring framework project, and my ant configuration appears to be not working. I\'ve searched quite a bit but

3条回答
  •  灰色年华
    2021-02-05 18:36

    I hope you are declaring before using env. notation.

    Also, below is the syntax in your build script to set specific environment variables.

    **Windows and OS/2**
    

    Assume Ant is installed in c:\ant. The following sets up the environment:

    set ANT_HOME=c:\ant
    set JAVA_HOME=c:\jdk-1.5.0.05
    set PATH=%PATH%;%ANT_HOME%\bin
    
    **Linux/Unix (bash)**
    

    Assume Ant is installed in /usr/local/ant. The following sets up the environment:

    export ANT_HOME=/usr/local/ant
    export JAVA_HOME=/usr/local/jdk-1.5.0.05
    export PATH=${PATH}:${ANT_HOME}/bin
    
    **Linux/Unix (csh)**
    
    setenv ANT_HOME /usr/local/ant
    setenv JAVA_HOME /usr/local/jdk/jdk-1.5.0.05
    set path=( $path $ANT_HOME/bin )
    

    Having a symbolic link set up to point to the JVM/JDK version makes updates more seamless.

提交回复
热议问题