什么版本的Java hamcrest-all v1.3兼容?

时间:2018-02-19 10:21:42

标签: java hamcrest

我找不到有关该问题的任何信息: 什么版本的Java hamcrest-all v1.3兼容?

1 个答案:

答案 0 :(得分:1)

Hamcrest 1.3的源代码中,文件BUILDING.txt包含以下语句:

--[ Build requirements ]-------------------------------------

* JDK 1.5
  Note: that this is a buildtime dependency for 1.5 specific
  features. However the final built jars should run on 1.4
  and 1.3 JVMs with some features unavailable.

Ant javac ...

中的build.xml命令进一步支持了这一点
<javac srcdir="@{srcdir}" destdir="build/temp/@{modulename}-${version}.jar.contents" 
    debug="${debug}" target="1.5" includeantruntime="false">
    ...
</javac>

因此,看起来Hamcrest 1.3与Java 1.5兼容,但据作者说......

  

它应该在1.4和1.3 JVM上运行,其中一些功能不可用

相比之下,Hamcrest 2.x假设来自build.gradle

的Java 1.7
import static org.gradle.api.JavaVersion.VERSION_1_7

sourceCompatibility = VERSION_1_7
targetCompatibility = VERSION_1_7