JUnit Eclipse Plugin?

176,412

Solution 1

JUnit is part of Eclipse Java Development Tools (JDT). So, either install the JDT via Software Updates or download and install Eclipse IDE for Java Developers (actually, I'd recommend installing Eclipse IDE for Java EE Developers if you want a complete built-in environment for server side development).

You add it to a project by right clicking the project in the Package Explorer and selecting Build Path -> Add Libraries... Then simply select JUnit and click Next >.

Solution 2

It's built in Eclipse since ages. Which Eclipse version are you using? How were you trying to create a new JUnit test case? It should be File > New > Other > Java - JUnit - JUnit Test Case (you can eventually enter Filter text "junit").

Solution 3

You should be able to add the Java Development Tools by selecting 'Help' -> 'Install New Software', there you select the 'Juno' update site, then 'Programming Languages' -> 'Eclipse Java Development Tools'.

After that, you will be able to run your JUnit tests with 'Right Click' -> 'Run as' -> 'JUnit test'.

Solution 4

You do not need to install or update any software for the JUnit. it is the part of Java Development tools and comes with almost most of the latest versions in Eclipse.

Go to your project. Right click onto that->Select buildpath->add library->select JUnit from the list ->select the version you want to work with-> done

build you project again to see the errors gone:)

Solution 5

Junit is included by default with Eclipse (at least the Java EE version I'm sure). You may just need to add the view to your perspective.

Share:
176,412

Related videos on Youtube

Nick Heiner
Author by

Nick Heiner

JS enthusiast by day, horse mask enthusiast by night. Talks I've Done

Updated on July 09, 2022

Comments

  • Nick Heiner
    Nick Heiner almost 2 years

    I feel stupid for not being able to find this, but where is the JUnit plugin for Eclipse? I've included the latest .jar in my buildpath, but I still don't have the option to create a new test case, run test cases with the green/red bar, etc. I need the plugin for this, right?

    EDIT: I'm using "Eclipse for PHP Developers". So perhaps that wouldn't include JUnit automatically. Do I have to download Eclipse again, or can I just get that functionality somehow?

  • Nick Heiner
    Nick Heiner over 14 years
    actually, I'm using PHP Eclipse (see above). Can this be fixed, or do I need to download again?
  • BalusC
    BalusC over 14 years
    I am not sure about that, sorry. But if you can't find it anywhere in the list, then I recommend to go get "Eclipse for Java developers" (or "Eclipse for Java EE developers" if you like to play with Java/JSP/Servlet webapps as well) and then add the PHP plugin afterwards.
  • aubreyrhodes
    aubreyrhodes over 14 years
    I can't find the Junit package fore eclipse after googleing around a bit, so I think your best bet would just be to download a java version of eclipse.
  • BalusC
    BalusC over 14 years
    Just a note, J2EE is renamed Java EE since a year or three.
  • Devanshu Mevada
    Devanshu Mevada over 14 years
    @aubreyrhodes FYI, it's included in the JDT.