|How to make classes available at run-time? [message #211102]
||Wed, 27 July 2005 16:50
Originally posted by: nnyrs4z02.sneakemail.com|
I can't seem to get classes in third-party jars to stick in my
stand-alone executable, and I was hoping that someone here could help me
I have a project called MyApplication which depends on a project called
Common which contains a jar called MySQL (names simplified for easier
typing here). If I run under Eclipse, everything works fine. If I try
to run it as a stand-alone executable, I get NoClassDefFoundError for
the classes in the MySQL jar.
I checked off the MySQL.jar check-box in the "Order and Export" tab of
the Properties for the Common project. I checked off the Common
check-box in the "Order and Export" tab of the Properties for the
MyApplication project. And, in the jar-packager to create
MyApplication.jar, I checked off the MySQL library under "Select
resources to export". Is there something else I need to take care of?
I'm not sure whether the problem is that the MySQL classes aren't being
put in my final executable jar, or if they're there but just can't be
found by the JVM -- on the other hand, I'm also not sure how I would
check to see which of those possibilities is actually occurring.
BTW, if solving this requires modifying the classpath, I would prefer a
solution that would allow me to just copy the executable jar to various
machines, without having to manually (or via an install-script) set the
classpath on each target machine....
|Re: How to make classes available at run-time? [message #211121 is a reply to message #211102]
||Wed, 27 July 2005 17:51
Originally posted by: richkulp.us.NO_SPAM.ibm.com|
Third-party jars are not included in an exported jar. You must include
it in the classpath of the java command line when you start the
It is typically not permitted due to licensing requirement to reship the
contents of a third-party jar. It depends on the licensing of that jar
if that is allowed or not.
Powered by FUDForum
. Page generated in 0.01574 seconds