可是我看到pom.xml已经有:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
maven dependency里面也看到junit的jar包了
错误代码:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[3,17] 程序包org.junit不存在
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[4,17] 程序包org.junit不存在
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[19,10] 找不到符号
符号: 类 Before
位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[28,10] 找不到符号
符号: 类 Test
位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[36,10] 找不到符号
符号: 类 Test
位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[67,10] 找不到符号
符号: 类 Test
位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[98,10] 找不到符号
符号: 类 Test
位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[115,10] 找不到符号
符号: 类 Test
位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[131,10] 找不到符号
符号: 类 Test
位置: 类 com.ruishenh.redis.example.JedisUtilTest
[INFO] 9 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.101 s
[INFO] Finished at: 2015-09-18T10:01:05+08:00
[INFO] Final Memory: 15M/196M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project gomeTest: Compilation failure: Compilation failure:
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[3,17] 程序包org.junit不存在
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[4,17] 程序包org.junit不存在
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[19,10] 找不到符号
[ERROR] 符号: 类 Before
[ERROR] 位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[28,10] 找不到符号
[ERROR] 符号: 类 Test
[ERROR] 位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[36,10] 找不到符号
[ERROR] 符号: 类 Test
[ERROR] 位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[67,10] 找不到符号
[ERROR] 符号: 类 Test
[ERROR] 位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[98,10] 找不到符号
[ERROR] 符号: 类 Test
[ERROR] 位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[115,10] 找不到符号
[ERROR] 符号: 类 Test
[ERROR] 位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] /E:/download from the net/gomeTest/src/main/java/com/ruishenh/redis/example/JedisUtilTest.java:[131,10] 找不到符号
[ERROR] 符号: 类 Test
[ERROR] 位置: 类 com.ruishenh.redis.example.JedisUtilTest
[ERROR] -> [Help 1]
7 个解决方案
#1
你们你看下这个 jar 下载下来了没有
#2
右键项目--》Build Path--》Add Libraries--》JUnit--》Next--》Finish
#3
我照着做了,好像还是报同样的错来着
#4
已解决,重新导了一遍项目,不知道为什么又不报这个错了
#5
感谢,帮到了我
#6
<scope>test</scope>去掉应该可以
#7
同样遇到该问题,目前尚不知道原因
#1
你们你看下这个 jar 下载下来了没有
#2
右键项目--》Build Path--》Add Libraries--》JUnit--》Next--》Finish
#3
我照着做了,好像还是报同样的错来着
#4
已解决,重新导了一遍项目,不知道为什么又不报这个错了
#5
感谢,帮到了我
#6
<scope>test</scope>去掉应该可以
#7
同样遇到该问题,目前尚不知道原因