|
Re: problem using external jar files [message #426187 is a reply to message #426175] |
Thu, 18 December 2008 14:30 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Simon,
Comments below.
Simon Chen wrote:
> Hi all,
>
> I have problem using external jar files. It's very strange that the
> jar files have no problem at all in another project not generated by
> EMF: basically, they are added as external jars and work just fine.
You've been messing with the project's properties directly?
>
> On the other hand, for my EMF-powered project, I tried to do the same
> thing by adding those jar files as external libraries, in my "project"
> and "project.edit" and "project.editor". The project can be compiled
> without a problem. I launched "project.editor" as an eclipse
> application and when I try to instantiate a new object of a class that
> uses that external jars, it would show:
>
> java.lang.NoClassDefFoundError:
> com/sshtools/j2ssh/transport/HostKeyVerification
>
> For those that are interested, I am trying to use the jars files for
> j2ssh, an open source ssh2 component for java.
You'd find if you used your approach with any other plugin projects
you'd have the same problem. When building Eclipse applications you
should NEVER modify the classpath directly via the project's
properties. You should ALWAYs edit the MANIFEST.MF's dependencies.
That's because the MANIFEST.MF is used to control the classpath both at
development time and runtime, so if you bypass it, you'll fix your
development time problems only to have them come back as runtime.
You need to package your external jar as a bundle so you can create
bundle dependencies on it, or include it in one of your existing bundles
(not such a great approach).
>
> Thanks.
> -Simon
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02600 seconds