Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to make classes available at run-time?
How to make classes available at run-time? [message #211102] Wed, 27 July 2005 20:50 Go to next message
Eclipse User
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
out.

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....

Thanks!
Jonathan
Re: How to make classes available at run-time? [message #211121 is a reply to message #211102] Wed, 27 July 2005 21:51 Go to previous message
Eclipse User
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
stand-alone executable.

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.

--
Thanks,
Rich Kulp
Previous Topic:Type parameter constraints
Next Topic:debugging jdk code
Goto Forum:
  


Current Time: Wed Oct 22 15:41:41 GMT 2014

Powered by FUDForum. Page generated in 0.03953 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software