Setting the target version of Java in ant javac

前端 未结 4 1059
轮回少年
轮回少年 2020-12-02 21:40

I need to compile a jar file using ant (1.7.0) to run under a specific version of Java (1.5). I currently have Java 1.6 on my machine. I have tried setting:

         


        
4条回答
  •  爱一瞬间的悲伤
    2020-12-02 22:38

    Both source and target should be specified. I recommend providing ant defaults, that way you do not need to specify source/target attribute for every javac task:

    
    
    

    See Java cross-compiling notes for more information.

提交回复
热议问题