[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.newcomer] Help exporting to JAR file
|
I'm using Eclipse 3.0.2 in Windows, and I'm trying to
export a project to a JAR file. The project relies on
JDBC, which uses a JAR file called jconn2.jar. I'm
trying (and failing) to have jconn2.jar exported as
part of the JAR file for my project. I don't know
whether I went wrong with the way I added jconn2.jar to
my project, the way I'm exporting it, or both.
Hopefully someone can tell me what I did wrong. Sorry
for the long-winded explanation.
In Eclipse, in the package explorer, I created a folder
called "lib". In lib, I did Import/From File System,
navigated to jconn2.jar, and opened it. At this point,
under my Project I see "lib" and under "lib" I see
"jconn2.jar."
Under my project properties, under Java Build Path/
Libraries, I did "Add JARs", navigated to lib/jconn2.jar,
and did OK. I verified that my project has correctly
added the JAR by running my app, and my app runs file.
So I know it's seeing & using jconn2.jar. (Note: when
I added jconn2.jar to the build path, it no longer
appears in the package explorer under the "lib" folder.
It's now directly under the project folder. Is this
right?)
Note: My project also contains an "images" directory with
a couple .gif files, which it uses just fine.
As further verification, I went to the O/S, verified that
the lib directory exists under my project directory, and
that it contains jconn2.jar.
Now I try to export to a JAR. I do File/Export/JAR file.
My project is checked under "Select the resources to
export." When I open it up, I can see my project, as well
as the two folders I created, "images" and "lib". Under
"images" I can see my two .gif files, both checked. Under
my project, package, I can see all my Java classes. But
under lib, nothing appears -- jconn2.jar does not show up.
Thinking maybe it throws jconn2.jar in there anyway, I go
ahead and create the JAR file, then open it up with WinZip.
As I suspected, jconn2.jar is not there.
So...am I associating jconn2.jar with my project incorrectly,
am I creating the JAR file incorrectly, or both? I'd
appreciate anybody pointing out where I went wrong. TIA.