problem in ant build invalid target release

前端 未结 5 1936
执念已碎
执念已碎 2021-01-17 10:41

problem in ant build

[javac] Compiling 86 source files to F:\\XXX\\classes
    [javac] javac: invalid target release: 1.6
    [javac] Usage: javac 

        
5条回答
  •  轮回少年
    2021-01-17 11:43

    You use a compiler that cannot compile with -target 1.6 (javac: invalid target release: 1.6). Are you sure you use the JDK 1.6? Maybe a JDK 1.5 is installed and used by ant. Check the used Java-version with adding following line to your target (at the beginning):

    
    

    It outputs the Java-version used by Ant.

    You can set the compiler to use a different Java-version. You have to use the fork-attribute to use an external javac and specify which one you want:

    
    

    Read the documentation of the javac-task for details.

提交回复
热议问题