Dave Stone
Dave Stone

Reputation: 209

Adding non-external JAR to Eclipse Java project

Similar questions have been asked but I still don't know/understand the answer. When adding a reference to a .jar in an Eclipse Java project, what is the difference between "Add JAR" and "Add External JAR"? I understand that the former is usually used for JARs built from other projects in the Eclipse workspace, but what is the difference between the two from the perspective of the referencing project?

Also when I click "Add Jar" and choose another project in my workspace that exports a .jar file, I don't see the .jar file in the file system GUI so I can't select it. In the screenshot below, I want to reference MiscUtils.jar in the MiscUtils project. The .jar is definately in the "bin" directory but it doesn't show up in the UI.

Thanks!

Eclipse IDE screenshot

Upvotes: 0

Views: 166

Answers (2)

Nandkumar Tekale
Nandkumar Tekale

Reputation: 16158

what is the difference between "Add JAR" and "Add External JAR"?

--> With Add External JAR, You can add jars from outside project, keeping out of your project workspace. With Add Jars, you can add jars from projects available in your current open workspace.

Upvotes: 0

kgautron
kgautron

Reputation: 8263

"Add jar" is to add a jar that is in the current project tree, so the UI shows only subdirectories of the project. "Add external jar" is to add a jar that can be located anywhere, so in this case the UI allows you to browse any folder on any available drive.

Upvotes: 1

Related Questions