Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » n00b qn: RCP runtime classpath?
n00b qn: RCP runtime classpath? [message #459711] Wed, 06 December 2006 12:35 Go to next message
Eclipse UserFriend
Originally posted by: null.bitbucket.net

Hi everyone,

(sorry if this is a duplicate post - first time posting this!)

I'm trying to track down a java.lang.NoClassDefFoundError exception that
I'm getting on a 3rd party jar file at runtime in my RCP application.
Compile time appears to be fine - I've added the jar in the project's
properties / Java Build Path and I'm not getting any errors there.

I've gotten the call to the 3rd party jar to work when I run it as a Java
application, by setting the runtime classpath (Run/Debug... menu command,
Classpath tab), but I can't find where the runtime classpath is set on an
RCP application. Can anyone tell me where this is?

Thanks in advance!
Re: n00b qn: RCP runtime classpath? [message #459713 is a reply to message #459711] Wed, 06 December 2006 12:52 Go to previous messageGo to next message
Eclipse UserFriend
This was a sore spot for me when I started using RCP as well. You have
to do structure things a little differently when writing plugins as
opposed to plain old java projects.

What you probably want to do is convert your 3rd party jar into a plugin
project, then add that plugin as a *plugin* dependency (not a build path
dependency):

* New Project -> Plug-in Development / Plug-in from Existing Jar
Archives, click Next
* Add your 3rd party jar to the list, click Next
* Choose the plugin name and plugin ID. I've seen people set this name
to something like com.3rdparty.product.eclipse to identify it as the
third party.
* Click Finish to import the jar into your workspace

Now the 3rd party Jar is a plug-in in your workspace. Remember to open
up the manifest and make sure that the appropriate packages are exported
for clients (you) in the Runtime tab.

Hope this helps,

Matthew

caffeinated wrote:
> Hi everyone,
>
> (sorry if this is a duplicate post - first time posting this!)
>
> I'm trying to track down a java.lang.NoClassDefFoundError exception that
> I'm getting on a 3rd party jar file at runtime in my RCP application.
> Compile time appears to be fine - I've added the jar in the project's
> properties / Java Build Path and I'm not getting any errors there.
>
> I've gotten the call to the 3rd party jar to work when I run it as a
> Java application, by setting the runtime classpath (Run/Debug... menu
> command, Classpath tab), but I can't find where the runtime classpath is
> set on an RCP application. Can anyone tell me where this is?
>
> Thanks in advance!
>
Re: n00b qn: RCP runtime classpath? [message #459716 is a reply to message #459713] Wed, 06 December 2006 14:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: null.bitbucket.net

Hi Matthew!

Thanks for the quick response! That does address the problem, kind of. I
seem to still be getting 3rd party of 3rd party
java.lang.NoClassDefFoundError exceptions now (going down into some
Systinet calls).

Is there another way to get these jars in the classpath without wrapping
them in an RCP plugin? Or do I really need to create separate plugin
wrappers for all my 3rd party jars?

Thanks again!
Re: n00b qn: RCP runtime classpath? [message #459717 is a reply to message #459716] Wed, 06 December 2006 14:55 Go to previous messageGo to next message
Eclipse UserFriend
No, RCP plugins can only see RCP plugins (with a few minor exceptions).

A useful list for creating them is at
http://wiki.eclipse.org/index.php/Plug-in_Development_Enviro nment

Later,
PW
Re: n00b qn: RCP runtime classpath? [message #459718 is a reply to message #459717] Wed, 06 December 2006 15:07 Go to previous messageGo to next message
Eclipse UserFriend
Paul Webster wrote:
> No, RCP plugins can only see RCP plugins (with a few minor exceptions).
>
> A useful list for creating them is at
> http://wiki.eclipse.org/index.php/Plug-in_Development_Enviro nment
>
> Later,
> PW

Another option is to create a regular plug-in project, add a "lib"
folder and put your jars in it, then add those jars to the Classpath
list on the plug-in manifest's Runtime tab. Then click Add... on the
Exported Packages list and export the packages you need access to. I
used this method to embed Hibernate in my app and it works very well.

The drawback to this method is that (somebody correct me if I'm wrong)
when your plugin can only export as a folder instead of a self-contained
jar when using embedded jars.

Matthew
Re: n00b qn: RCP runtime classpath? [message #459744 is a reply to message #459718] Thu, 07 December 2006 02:44 Go to previous message
Eclipse UserFriend
Originally posted by: jojy.sv.gmail.com

Hi Mattew,

Even if you put a jar inside your plugin and you still want to export it
as a jar it is possible.
I have used that
ie com.xx.xx.plugin.jar has a hibernate.jar inside,Only thing I did
was that i added the bibernate.jar and .,(because i did not bundle my
classes as jar) into the Bundle-Classpath and I exported the plugin as a
jar(by default the export wizard point to a folder and I selected jar
option) I have used eclipse 3.2 and java 5

Regards
George S

Matthew Hall wrote:

> Paul Webster wrote:
>> No, RCP plugins can only see RCP plugins (with a few minor exceptions).
>>
>> A useful list for creating them is at
>> http://wiki.eclipse.org/index.php/Plug-in_Development_Enviro nment
>>
>> Later,
>> PW

> Another option is to create a regular plug-in project, add a "lib"
> folder and put your jars in it, then add those jars to the Classpath
> list on the plug-in manifest's Runtime tab. Then click Add... on the
> Exported Packages list and export the packages you need access to. I
> used this method to embed Hibernate in my app and it works very well.

> The drawback to this method is that (somebody correct me if I'm wrong)
> when your plugin can only export as a folder instead of a self-contained
> jar when using embedded jars.

> Matthew
Previous Topic:View maximized/restored?
Next Topic:adding a view to the preference page to change color and font
Goto Forum:
  


Current Time: Sun Mar 16 05:56:48 EDT 2025

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

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

Back to the top