[beginner question] - including external jar - compile error

Hello,
I am begginer in Java and also learning to use IntelliJ 14, so please be patient with me and let me apologize in advance if following question is dumb.

I would like to ask, how to properly include JAR library in existing project. I mean, I have new project - only hello world template. Now, I would like to include following library in JAR file (http://tomp2p.net/dev/mvn/net/tomp2p/tomp2p-all/5.0-Beta8/tomp2p-all-5.0-Beta8-dist.zip), so I can do "import net.tomp2p....;" in Main class and use whatever classes/methods included in that JAR file in my main class.

I tried to do it according to Intellij help - meaning adding JAR through "Project Structure"->"Modules"->"Dependencies"->"+"-> I tried all three options here (Jar/Lib/Module dep), but once I compile I always get error: Error:(1, 1) java: package net.tomp2p does not exis... I tried to move jar file inside src folder, create lib forlder, put jar file there and assign it as library folder and even include it as "Project Structure"->"Library" but nothing worked...

I mean, shouldn't it be clear to IDE that once I put JAR file in the project that I actually want to use code within the file ? I feel like I am missing some important step here, so please if you may, let me know what to do or how to do it properly.

Thank you very much in advance and I am sorry for asking pretty basic question for all of you.
Thanks.
Joe

1 comment
Comment actions Permalink

Attach a sample project with the jar so that we can check what's the problem.

Dependencies are configured per http://www.jetbrains.com/idea/webhelp/configuring-module-dependencies-and-libraries.html .

0

Please sign in to leave a comment.