aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes adding a .jar file to a project in eclipse 3.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "adding a .jar file to a project in eclipse 3.2" Watch "adding a .jar file to a project in eclipse 3.2" New topic
Author

adding a .jar file to a project in eclipse 3.2

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
in order to test junit4, i downloaded it and then, after creating a new project in project properties window, in libraries tab, i selected add external library and added junit4.1 jar.

so far so good, but,imagine i wanna create a jar from my project, one jar that includes ALL needed jars for the working of my application.
If i try to create a jar from eclipse, when i try to add stuff to it, junit4.1 jar does not show up.
so, what can i do so that all my jars lie inside my proj?

TiA


java amateur
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Miguel,
The only way I know of to do this is to add a copy of the jar file under one of the directories in your project.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
can you please tell me how to do it?

TiA
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
after re reading my last post i feel like an idiot
add a copy of the jar file under one of the directories in your

of course i tried that with all imaginable diferent ways, but didnt work:
1. created a folder and imported the jar
2. unzipped the jar and imported the folder containing the unzipped stuff
3. imported the jar through eclipse
4. created an User Library
but all without results
[ July 25, 2006: Message edited by: miguel lisboa ]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Miguel,
I meant the simple approach. Literally copy/paste the jar under your project. (Make sure the checkbox is checked on the build path export tab.) Then export.
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
thank you, Jeanne

i did copy/paste the jar into my project;
as my test class turned up with lots of errors( because didnt find the jar), i went to properties/libraries/add external jar, and then browsed till finding the jar i had copied into my project
this way it really works

thanks again
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

However, things added through project properties I don't think show up on project export. I'm not entirely sure since I have been working with plugin projects and not plain java projects.
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
However, things added through project properties I don't think show up on project export.

since the jar IS in my project, it does show up
 
 
subject: adding a .jar file to a project in eclipse 3.2