Ant use -source 7 or higher to enable diamond operator

前端 未结 4 642
栀梦
栀梦 2021-02-05 09:21

I am sure this is pretty easy qoestion, but I am stuck with building Android app using Ant from commandline. I have got this message: (use -source 7 or higher to enable d

4条回答
  •  一向
    一向 (楼主)
    2021-02-05 09:53

    You need to set java.source and java.target. Either via -D:

    ant release -Djava.source=7 -Djava.target=7
    

    Or put it in ant.properties in your project:

    # ant.properies contents:
    java.source=7
    java.target=7
    

提交回复
热议问题