KostasA
KostasA

Reputation: 5578

Process of install the Junit library in Eclipse

Good morning guys,

what I am considering about is to build a standard process of installing a library in a java project in eclipse. I am a niewbie software developer so a prior sorry if this question is a bit stupid. All what I want to do is to use the junit library. I have followed these septs.

  1. I installed the junit-4.12.jar file from the web.
  2. Inside the project folder I created a new file and I named it "lib".
  3. I put in this folder thae jar file and then in eclipse I click on project folder -> properties -> Java build path and I click on libraries and add jars. (not external jars).

Is that process ok?

Upvotes: 0

Views: 312

Answers (1)

piotrek
piotrek

Reputation: 14550

your process isn't good because it doesn't scale: imagine you want to install 40 libraries in your project. and then imaging your team has 5 developers and each of them has to do the same. and what about CI server that must be automatic

in fact your problem was solved years ago and the solution is called 'dependency management tool'. those tools are usually built into something more powerful called 'build tool'. maven or gradle are examples of such tools. you just provide list of your dependencies (like junit) and that program automatically downloads them and build your project. and it's sufficient as long as your project is more less 'typical'

i don't remember if eclipse has build in support for maven (one of the oldest and most common). if not, just install the eclipse plugin and you're ready to go

Upvotes: 1

Related Questions