Announcement Announcement Module
No announcement yet.
How to find the required jar files? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to find the required jar files?

    I'm relatively new to java spring development and am confused as to how to find the jar files that would be required for any project I create.

    Specifically, I don't understand how one can be expected to quickly find a jar file based on an apparently inconsistent naming convention whre the library name is not the same as the filename.

    For example, a typical Spring helloworld tutorial tells me to "add the following jar files to the classpath", giving a list of jar files...

    One specific file in the list is while I'm not sure where to find these files, I search and locate a file in the spring framework libs directory with the filename "spring-context-support-3.2.2.RELEASE"

    I can only assume this is the right file based on the words "context-support" which I had to manually recognize by scanning the files in the spring directory.

    As another example, a tutorial requests antlr-runtime-3.0.jar, which I had to search for and found a file in my <ECLIPSE_HOME>\plugins directory: named which varies completely other than the 5 letter word.

    To me, this could become incredibly tedious as the effort is preportional to the number of jar files you have.

    Is there an easier more direct way to manually resolve these library references without taking extra time evaluating the similarities of every file in a directory?

  • #2

    I totally agree with you that manually searching and adding those library JARs is tedious and error-prone. Therefore most people use some kind of build tooling that solves these issues. Maven is one that many people use and that is also used in many of the example and tutorial projects for Spring.

    If you are not familiar with Maven, I would recommend to take a look at it:

    In case you use the Spring Tool Suite distribution, it contains a Maven Integration for Eclipse that does all the tedious work for you. The Spring template projects also use Maven for their dependency management, so if you create a new Spring MVC project from the Spring Template Projects inside of STS, you can get an impression of how that works.

    There are other build tools that include some kind of dependency resolution as well, of course, like Ivy or Gradle.