0

This title is extremely close to How to add external library in IntelliJ IDEA? and Correct way to add external jars (lib/*.jar) to an IntelliJ IDEA project. However, I already have checked them.

In "How to add external library in IntelliJ IDEA? ", I don't understand the best answer's meaning well and the person who had the same question asked on the comment space. So, someone gave him a response that showed "Correct way to add external jars (lib/*.jar) to an IntelliJ IDEA project". I also followed the link which was shown and found how to add Jar file to external library on IntelliJ.

I have two Jar files I want to use as library in my project and one was already done by just following the shown procedure. But, another is not done yet. Actually, the successfully added one is java.persistence.jar and not done one is play-java-ebean_2.10-sources.jar.

To clarify what I did to everyone, I write it here. File -> Project Structure -> Modules -> Dependencies -> + mark -> Choosing correct file(play-java-ebean_2.10-sources.jar) -> apply

Why do I fail to add the jar file to external library? What should I do?

Thank you for your help.

Community
  • 1
  • 1
Kazuya Tomita
  • 667
  • 14
  • 34

1 Answers1

0

You are trying to add a *-sources.jar, which is a file that only contains the sources (this is useful if you are debugging, and want to see what the library is doing).

Instead you need to add the jar file with the compiled code. Given the library name you mention, that would usually be called play-java-ebean_2.10.jar (that is: without -sources).

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197