可能重複:
Maven Install: 「Annotations are not supported in -source 1.3」我用maven測試運行我的項目,但它說我是用JDK 1.3
我使用Ubuntu 10.04和開放JDK-1.6.0。
這是我MVN -version輸出:
Apache Maven 2.2.1 (rdebian-1)
Java version: 1.6.0_20
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-37-generic" arch: "i386" Family: "unix"
但是當我運行mvn測試,存在一些誤區:
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/DataTypeTest.java:[3,7] static import declarations are not supported in -source 1.3
(use -source 5 or higher to enable static import declarations)
import static org.junit.Assert.assertEquals;
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/DataTypeTest.java:[11,2] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Test
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/ChannelBufferTest.java:[3,7] static import declarations are not supported in -source 1.3
(use -source 5 or higher to enable static import declarations)
import static org.junit.Assert.*;
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/ChannelBufferTest.java:[11,2] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Test
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/PathTest.java:[3,7] static import declarations are not supported in -source 1.3
(use -source 5 or higher to enable static import declarations)
import static org.junit.Assert.*;
/home/unionx/workspace/java/try-netty/src/test/java/net/bluedash/trynetty/PathTest.java:[11,2] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Test
我看來,MVN以爲我用Java 1.3的,也許它只是支持Java 1.5?
發佈您的pom.xml – subodh 2011-12-14 05:58:23