Avatar of gudii9
gudii9
Flag for United States of America asked on

junit as external jar or library

what is difference bewteen adding junit as external jar or as Libray as attached.

I got error initally saying Error: Could not find or load main class
when i run as juni tclass.

when i added Library then junit 4(earlier it was only added as external jar) i was able to run the test case.

Please advise.
jarsJunit.png
* JUnitJavaJava EE

Avatar of undefined
Last Comment
gudii9

8/22/2022 - Mon
CEHJ

when i run as juni tclass.
Are you saying that you're trying to run JUnit as an app? If so, that's not what you're meant to do
gudii9

ASKER
In eclipse i was right clicking on the junit class say xyzrtest.java then run as JUnit TEst class then getting error
CEHJ

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
gudii9

ASKER
run time errOR I am getting is
Error: Could not find or load main class
when i run as junit class by right clicking on that junit class in eclipse.
ASKER CERTIFIED SOLUTION
CEHJ

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gudii9

ASKER
as it is junit no need of junit right. but it got resolved when i added JUnit Library later(initially i added junit as external library as in screenshot in original question which did not resolve the issue though). my question is difference between adding as Library and adding as external jar?
gudii9

ASKER
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.