How to tell ant to build using a specific javac executable?

前端 未结 4 1634
心在旅途
心在旅途 2020-12-15 07:47

How can I tell ant to use a specific javac executable from the command line?

I have an installation of gcj, built as part of gcc, within a library we di

4条回答
  •  情话喂你
    2020-12-15 08:18

    The -D argument when calling ant will use a property from the command line inside of the Ant script. The form that it is used in is:

    ant -Dmyvar=true

    Where myvar is the name of the property, and true is the value you want to use in your script.

    The easiest way then would be to use a property for your javac executable attributes.

       
         
     
    

    and then on the command line you could call:

    ant compile -Djavac.executable=/usr/bin/local/jdk/javac -Dsrc=/home/src -Dbuild=/home/build -Dcompiler=javac1.6 -Dfork=true
    

提交回复
热议问题