How to know the version of JUnit in Eclipse

2019-02-16 20:26发布

问题:

In eclipse:

  1. Window --> Preferences
  2. Expand Java at left side of panel --> JUnit is there under Java

How can I know the version of JUnit in eclipse?

回答1:

You can use this code:

import junit.runner.Version;

System.out.println("JUnit version is: " + Version.id());


回答2:

If you selected JUnit4 over JUnit3, the version that Eclipse uses is the one in eclipse/plugins/org.junit_XXXX. For Eclipse Luna, it is eclipse/plugins/org.junit_4.11.0.v201303080030. Note that if you want to change it, based on all the things I tried, you can replace the junit.jar contained inside with the version you want.



回答3:

Go to the project properties --> java build path --> in libraries tab you will see the junit jar. see the version on it.



回答4:

what ever junit jar you might have upload to build path in eclipse will be the version of junit.



回答5:

version of junit.jar will tell u the version of your JUNIT in eclipse. I think it may be 
hidden in that jar