How to get junit on classpath?

Nick Williams nicholas+openjdk at nicholaswilliams.net
Tue Jul 30 14:43:58 PDT 2013


I'm getting this error on many tests in JDK:

java.lang.Exception: No JUnit 4 driver (install junit.jar next to jtreg.jar)
    [stack trace]

As you can see, junit.jar is installed next to jtreg.jar:

nickwilliams:jtreg Nicholas$ echo $JT_HOME
/usr/share/java/jtreg
nickwilliams:jtreg Nicholas$ cd $JT_HOME
nickwilliams:jtreg Nicholas$ ls -al
total 64
drwxr-xr-x  12 root  wheel    408 Jul 30 12:29 .
drwxr-xr-x  15 root  wheel    510 Jul 30 12:29 ..
-rw-r--r--   1 root  wheel    994 Jul 30 12:29 COPYRIGHT
-rw-r--r--   1 root  wheel  19241 Jul 30 12:29 LICENSE
-rw-r--r--   1 root  wheel   3790 Jul 30 12:29 README
drwxr-xr-x   3 root  wheel    102 Jul 30 12:29 doc
drwxr-xr-x   4 root  wheel    136 Jul 30 12:29 legal
drwxr-xr-x   7 root  wheel    238 Jul 30 12:29 lib
drwxr-xr-x   3 root  wheel    102 Jul 30 12:29 linux
-rw-r--r--   1 root  wheel     73 Jul 30 12:29 release
drwxr-xr-x   3 root  wheel    102 Jul 30 12:29 solaris
drwxr-xr-x   3 root  wheel    102 Jul 30 12:29 win32
nickwilliams:jtreg Nicholas$ ls -al lib
total 13200
drwxr-xr-x   7 root  wheel      238 Jul 30 12:29 .
drwxr-xr-x  12 root  wheel      408 Jul 30 12:29 ..
-rw-r-xr-x@  1 root  wheel  4613089 Jul 30 12:29 javatest.jar
-rw-r--r--@  1 root  wheel   508396 Jul 30 12:29 jh.jar
-r--r--r--   1 root  wheel   542604 Jul 30 12:29 jtreg.jar
-rw-r--r--@  1 root  wheel   245039 Jul 30 12:29 junit.jar
-rw-r--r--@  1 root  wheel   835600 Jul 30 12:29 testng.jar

I even tried setting the CLASSPATH system variable, to no avail. Made no difference one way or the other.

nickwilliams:test Nicholas$ echo $CLASSPATH
/usr/share/java/jtreg/lib/javatest.jar:/usr/share/java/jtreg/lib/jh.jar:/usr/share/java/jtreg/lib/junit.jar:/usr/share/java/jtreg/lib/testng.jar

I'm running JDK8 tests using Makefile.

Thoughts?

Nick


More information about the jtreg-use mailing list