Ant is using wrong java version

前端 未结 16 1510
小蘑菇
小蘑菇 2020-11-28 09:20

I\'m using Ant 1.7.0 and installed java 1.6 which is in JAVA_HOME.

I want to build a project using java 1.5, so I\'ve exported JAVA_HOME to be my java 1.5 directory.

16条回答
  •  日久生厌
    2020-11-28 10:00

    You can use the target and source properties on the javac tag to set a target runtime. The example below will compile any source code to target version 1.4 on any compiler that supports version 1.4 or later.

    
    

    Note: The 'srcdir' and 'destdir' are property values set else where in the build script, e.g.

提交回复
热议问题