13 answers to this question.
The best way is to add the jar to your project is as follows:
Create a folder called lib in your project folder.
copy all the jar files you need to this folder .
Refresh your project in eclipse.
Select all the jar files, then right click on one of them and select Build Path -> Add to Build Path
In eclipse
right click on your project
Click build path
Add external libraries
You are good to go.
The best way is to add the jar to your project is as follows:
Create a folder called lib in your project folder.
copy all the jar files you need to this folder.
Select all the jar files, then right click on one of them and select Build Path -> Add to Build Path
You can also create a "lib" folder in the root of your project. Put you jar library in.
And then boot up intellij, right click on your java, and select "Use as library".
Just did this to my own project.
Another approach could be:
Launch IntelliJ IDEA. If the Welcome screen opens, press Ctrl+Shift+A , type project from existing sources , and click the Import project from existing sources action in the popup. Otherwise, from the main menu, select File | New | Project from Existing Sources.
IntelliJ IDEA 15 & 2016
- File > Project Structure... or press Ctrl + Alt + Shift + S.
- Project Settings > Modules > Dependencies > "+" sign > JARs or directories...
- Select the jar file and click on OK, then click on another OK button to confirm.
- You can view the jar file in the "External Libraries" folder.
• 65,890 points
Related Questions In Java
I've recently converted over to IntelliJ Idea 13, previously in eclipse I was able to add a project to another project's build path. I'm not able to accomplish this in IntelliJ.
How can I add project1 to project2's build path so that I can use it as a dependency. I don't want to make that project a JAR because I'm still developing it.
Following this similar previous question: Intellij - Add project dependency like in Eclipse
I was not able to successfully achieve my goal.
In File > Project Structure > Modules
I see the project I'd like to add to my build path (DataProvider) but it's highlighted red, and the bottom warning text states "Invalid item 'DataProvider' in dependencies list'
Any help or assistance would be much appreciated.
Edit:
Solution (Thanks @leeor)
Import project as a module
File > Import Module > (Select Project to be imported)
This will add that project to the project view pane on the left side of the screen.
Then go to your current project
File > Project Structure > Module > (Select your current project)
Under Dependencies
Check mark your project (now a module) you want to import and then click apply and then OK.
Done!
Using IntelliJ Idea 13.1.6 on Mac