This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

adding a .jar file to a project in eclipse 3.2

 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34371
345
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please tell me how to do it?

TiA
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34371
345
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic