簡體   English   中英

ant 和 jdk 1.6 但用 1.5 編譯

[英]ant and jdk 1.6 but compile with 1.5

java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode)

在 ant 中,我需要使用 java 1.5 進行編譯。 我像這樣嘗試:

<javac destdir="${dest.dir}/${package.name}/${model.dir}/${output.dir}"
           classpathref="classpath"
           debug="${javac.debug}" nowarn="${javac.nowarn}" fork="true" verbose="${verbose}"
           deprecation="${javac.deprecation}" encoding="Cp1250" source="1.5"
           target="1.5" memoryinitialsize="1024m"
           memorymaximumsize="1024m">

但看起來 ant 仍然用 1.6 編譯。 我可以看到哪個 java ant 用於編譯嗎? 我收到“.class 文件中的錯誤版本號”錯誤

我可以看到哪個 java ant 用於編譯嗎?

嘗試這個:

<echo message="ant.java.version: ${ant.java.version}" />

另請閱讀此線程以獲得更多幫助: Ant is using wrong java version

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM