This topic has
11
replies
on
1
page.
dear friends,
how can i distribute the driver of the MySql within my JAR ?
DrClap
Posts:38,739
Registered: 4/30/99
You don't. You distribute it with your jar as a separate item.
ok, there is no way to include the driver jar into a single JAR ?
DrClap
Posts:38,739
Registered: 4/30/99
What's so difficult about distributing two files? Most software distributions contain far more files than that.
dmbdmb
Posts:4,208
Registered: 5/26/00
there are tools out there that basically provide a custom class loader to be able to load jars from within jars. one such one is
http://one-jar.sourceforge.net/
and there are others.
frankly, i'm amazed this isn't built in.
just technologic curiosity .... you know, pushing Java a bit ahead....
the stress: I need to distribute a ZIP, the user should unzip that and then run te application...
it seems much better the user download a single JAR whithout dependency of external tools...
UTK
Posts:1
Registered: 11/25/05
Re: distributing the MySql driver inside a JAR - how to ?
Nov 25, 2005 6:37 AM
(reply 6
of 11) (In reply to
#5 )
Maybe it helps you :
"A Read-only database in a jar?"
http://weblogs.java.net/blog/bernt/archive/2005/10/a_readonly_data.html
Felipe,
I have posted a comment to your blog on this topic (the blog: http://weblogs.java.net/blog/felipegaucho/archive/2005/11/deliver_your_ja.html).
Thanks,
Steev Coco.
Re: distributing the MySql driver inside a JAR - how to ?
Nov 25, 2005 8:23 AM
(reply 8
of 11) (In reply to
#7 )
There's a tool called "GenJar", I found on sourceforge which will assemble a composite jar from a classpath by chasing class references. Runs as an ant task. You'd have to specify the driver class explicitly.
strf
Posts:5
Registered: 10/16/98
I usually use ANT to fuse all my jars in one with this task
<jar jarfile="myapp.jar" basedir="classes" excludes="" >
<zipgroupfileset dir="libs" includes="*.jar" />
<manifest>
<attribute name="Implementation-Title" value="${name}" />
<attribute name="Implementation-Version" value="${version}-${build}" />
<attribute name="Implementation-Vendor" value="${vendor}" />
<attribute name="Created-By" value="${author}" />
<attribute name="Main-Class" value="${main}" />
<attribute name="Class-Path" value="${classpath}" />
</manifest>
</jar>
markg4
Posts:5
Registered: 6/1/06
Re: distributing the MySql driver inside a JAR - how to ?
Apr 2, 2008 11:00 AM
(reply 10
of 11) (In reply to
#9 )
cafal
Posts:734
Registered: 12/5/97
I'm sure the above posters have all been waiting two years for your stirring response. Well done! Now they can get on with their lives.
This topic has
11
replies
on
1
page.
Back to Forum
Read the Developer Forums Code of Conduct
Email this Topic
Edit this Topic
Site Upgrade
Forums 7.1.8 was deployed Oct 26th. The release consists of minor fixes & a few enhancements.
Forums Statistics
Users Online : 26 Guests : 129
About Sun forums
Sun Forums is a large collection of user generated
discussions. It is here to help you ask questions, find answers, and
participate in discussions.
Check out our guide on Getting
started with Sun Forums for a full walkthrough of how to best
leverage the benefits of this community.