What is the correct way to add external Jars to IntelliJ IDEA Project

0 votes
I want to configure IntelliJ IDEA to include my dependency jar files. Is there any way to connect external jars to the IntelliJ iDEA project?
Jun 22, 2018 in Java by Daisy
• 8,120 points
185,368 views

13 answers to this question.

0 votes
  1. Click File from the toolbar
  2. Project Structure (CTRL + SHIFT + ALT + S on Windows/Linux, ⌘ + ; on Mac OS X)
  3. Select Modules at the left panel
  4. Dependencies tab
  5. '+' → JARs or directories
answered Jun 25, 2018 by Parth
• 4,630 points
Works! Thanks!
0 votes

To import jar file in your Eclipse IDE, follow the steps given below.

  1. Right click on your project
  2. Select Build Path
  3. Click on Configure Build Path
  4. Click on Libraries and select Add External JARs
  5. Select the jar file from the required folder
  6. Click and Apply and OK
answered Dec 10, 2018 by Samarth
I think the question was about Eclipse.

Hey, @There,

Do you want any more information about the above-given solution? Yes, it is about Eclipse.

0 votes

You can add a jar file in Eclipse by: 
right-clicking on the Project → Build Path → Configure Build Path. 
Under Libraries tab, click Add Jars or Add External JARs and give the Jar.

Simple as that.

answered Dec 10, 2018 by Nitesh
0 votes

The best way is to add the jar to your project is as follows:

  1. Create a folder called lib in your project folder.

  2. copy all the jar files you need to this folder .

  3. Refresh your project in eclipse.

  4. Select all the jar files, then right click on one of them and select Build Path -> Add to Build Path

answered Dec 10, 2018 by Shuvodip
0 votes

Eclipse -> Preferences -> Java -> Build Path -> User Libraries -> New(Name it) -> Add external Jars

Done.

answered Dec 10, 2018 by Timsberg
0 votes

Right click on your project and choose Build Path -> Add Library

Then configure the build path and you are good to go.

answered Dec 10, 2018 by Ritesh
0 votes
In eclipse

right click on your project

Click build path

Add external libraries

You are good to go.
answered Dec 10, 2018 by Harpreet
0 votes

Go to your project right click and select build path 

then configure path and add your jar files in bin and you are good to go

answered Dec 10, 2018 by Sumitra
0 votes
answered Dec 10, 2018 by Rulutima
0 votes

The best way is to add the jar to your project is as follows:

  1. Create a folder called lib in your project folder.

  2. copy all the jar files you need to this folder.

  3. Select all the jar files, then right click on one of them and select Build Path -> Add to Build Path

answered Dec 10, 2018 by Nabarupa
0 votes
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.
answered Jul 17, 2020 by Zeenu
0 votes

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

  1. File > Project Structure... or press Ctrl + Alt + Shift + S.
  2. Project Settings > Modules > Dependencies > "+" sign > JARs or directories...
  3. Select the jar file and click on OK, then click on another OK button to confirm.
  4. You can view the jar file in the "External Libraries" folder.
answered Dec 10, 2020 by Gitika
• 65,910 points
0 votes

Adding custom JAR files to the EAR project

  1. Copy the custom JAR to the root directory of the EAR project.
  2. Define the JAR as a Utility JAR. Open the Java EE perspective. ...
  3. Add the new JAR to the class path by adding it to the MANIFEST. MF file. ...
  4. Republish the WebSphere Commerce application.

Contrary to what people have said here, you can put an external jar in a folder under your checked-out project directory and haven Maven find it like other dependencies. Here are two crucial steps: Use "mvn install:install-file" with -DlocalRepositoryPath. Configure a repository to point to that path in your POM

answered Dec 10, 2020 by Nikita

Related Questions In Java

0 votes
2 answers

what is the best way to convert an ArrayList to a String

You could probably use the Joiner class ...READ MORE

answered Aug 19, 2019 in Java by Sirajul
• 59,230 points
931 views
0 votes
1 answer

What is the simplest way to read JSON from a URL in java

Read json from url use url.openStream() and read contents ...READ MORE

answered Jun 13, 2018 in Java by samarth295
• 2,220 points
4,800 views
0 votes
2 answers

What is the easiest way to iterate through the characters of a string in Java?

There are two approaches to this: for(int i ...READ MORE

answered Aug 19, 2019 in Java by Sirajul
• 59,230 points
1,475 views
0 votes
2 answers

In Java, what is the best way to determine the size of an object?

I happened to find a java class "jdk.nashorn.internal.ir.debug.ObjectSizeCalculator", ...READ MORE

answered Aug 19, 2019 in Java by Sirajul
• 59,230 points
12,162 views
0 votes
1 answer

Retrieving the path of a running jar file

Its quite simple. Try using the below ...READ MORE

answered May 25, 2018 in Java by geek.erkami
• 2,680 points
10,319 views
0 votes
1 answer

How to run the JAR files in windows?

Following are the steps to run the ...READ MORE

answered May 28, 2018 in Java by Parth
• 4,630 points
888 views
0 votes
2 answers

How can we add the local JAR files to the Maven Project in Java?

Firstly I would like to give credit ...READ MORE

answered Nov 5, 2018 in Java by Sushmita
• 6,910 points
10,159 views
0 votes
1 answer

How to run a JAR file in Java?

The command given below will help you ...READ MORE

answered Jun 1, 2018 in Java by Parth
• 4,630 points
7,126 views
0 votes
2 answers

What is the difference between = and equals()?

The equals() method compares the "value" inside String instances ...READ MORE

answered Aug 13, 2018 in Java by Daisy
• 8,120 points
1,076 views
0 votes
1 answer

What is the difference between package private, public, protected?

Modifier Class Package Subclass World Public Y Y Y Y Protected Y Y Y N No modifier Y Y N N private Y N N N   Public: Any package, any class accessibility is ...READ MORE

answered May 24, 2018 in Java by Parth
• 4,630 points
1,354 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP