Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » class loader is unable to load swt at runtime
icon5.gif  class loader is unable to load swt at runtime [message #506801] Sun, 10 January 2010 12:10 Go to next message
Praveen  is currently offline Praveen Friend
Messages: 4
Registered: January 2010
Junior Member
I create a new plugin in eclipse and run it in as a seperate eclipse application , the new worbench opens successfully but when I click the menu which I created by defining actionsets in plugin.xml, my plugin doesn't run neither it shows any error.
when I debug the code which runs by clicking the menu,
the debugger comes up to this line of code only ;
Display disp= new Display();

I include all swt jars in runtime , still it says that ClassLoader is unable to load
swt.widget;

please suggest
Thanks
Re: class loader is unable to load swt at runtime [message #506812 is a reply to message #506801] Sun, 10 January 2010 14:59 Go to previous messageGo to next message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 68
Registered: July 2009
Member
On 1/10/2010 5:40 PM, Praveen wrote:
> I create a new plugin in eclipse and run it in as a seperate eclipse
> application , the new worbench opens successfully but when I click the
> menu which I created by defining actionsets in plugin.xml, my plugin
> doesn't run neither it shows any error.
> when I debug the code which runs by clicking the menu,
> the debugger comes up to this line of code only ;
> Display disp= new Display();
>
> I include all swt jars in runtime , still it says that ClassLoader is
> unable to load swt.widget;
>
> please suggest
> Thanks

If you are creating a RCP application then the SWT plugins shall be added as a required plugins.
The SWT jars are added to class path when you wish to create a Java application and want to use SWT
to create UI.

hth,
--
Ankur..
Eclipse PDE UI Committer | IBM India Software Lab, Bangalore
+91-99456-94011 | @ankur_sharma | http://blog.ankursharma.org
Re: class loader is unable to load swt at runtime [message #506853 is a reply to message #506812] Mon, 11 January 2010 01:07 Go to previous messageGo to next message
Praveen  is currently offline Praveen Friend
Messages: 4
Registered: January 2010
Junior Member
This is not a RCP application , and SWT plugin dependencies are already included at the time of Plugin creation , I included the swt jars in Runtime ClassPath also, still the problem is not solved , When I debug the code the following values are displayed in the Variable window as I proceed from the following line of code :

Display disp =new Display();

the vaues are :
this DefaultClassLoader
name org.eclipse.swt.widgets.Display
resolve false
Re: class loader is unable to load swt at runtime [message #507033 is a reply to message #506853] Mon, 11 January 2010 17:57 Go to previous message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 68
Registered: July 2009
Member
On 1/11/2010 6:37 AM, Praveen wrote:
> This is not a RCP application , and SWT plugin dependencies are already
> included at the time of Plugin creation , I included the swt jars in
> Runtime ClassPath also, still the problem is not solved , When I debug
> the code the following values are displayed in the Variable window as I
> proceed from the following line of code :
>
> Display disp =new Display();
>
> the vaues are :
> this DefaultClassLoader
> name org.eclipse.swt.widgets.Display
> resolve false

You don't include both plugin dependencies and SWT jars to classpath. Are you sure you are not doing
an RCP application?

Since you are creating a plugin, it will run either on a host eclipse or in an RCP application. In
either case you won't create a new Display, instead use one from workbench.
The stand alone java applications needs SWT Jars in classpath. That is, they are supposed to run
without Eclipse Runtime.

I suggest you first go through SWT articles at SWT home page http://www.eclipse.org/swt/eclipse.php
Have a look at snippets http://www.eclipse.org/swt/snippets/ and example
http://www.eclipse.org/swt/examples.php before you proceed.


hth,
--
Ankur..
Eclipse PDE UI Committer | IBM India Software Lab, Bangalore
+91-99456-94011 | @ankur_sharma | http://blog.ankursharma.org
Re: class loader is unable to load swt at runtime [message #604063 is a reply to message #506812] Mon, 11 January 2010 01:07 Go to previous message
Praveen  is currently offline Praveen Friend
Messages: 4
Registered: January 2010
Junior Member
This is not a RCP application , and SWT plugin dependencies are already included at the time of Plugin creation , I included the swt jars in Runtime ClassPath also, still the problem is not solved , When I debug the code the following values are displayed in the Variable window as I proceed from the following line of code :

Display disp =new Display();

the vaues are :
this DefaultClassLoader
name org.eclipse.swt.widgets.Display
resolve false
Re: class loader is unable to load swt at runtime [message #604093 is a reply to message #604063] Mon, 11 January 2010 17:57 Go to previous message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 68
Registered: July 2009
Member
On 1/11/2010 6:37 AM, Praveen wrote:
> This is not a RCP application , and SWT plugin dependencies are already
> included at the time of Plugin creation , I included the swt jars in
> Runtime ClassPath also, still the problem is not solved , When I debug
> the code the following values are displayed in the Variable window as I
> proceed from the following line of code :
>
> Display disp =new Display();
>
> the vaues are :
> this DefaultClassLoader
> name org.eclipse.swt.widgets.Display
> resolve false

You don't include both plugin dependencies and SWT jars to classpath. Are you sure you are not doing
an RCP application?

Since you are creating a plugin, it will run either on a host eclipse or in an RCP application. In
either case you won't create a new Display, instead use one from workbench.
The stand alone java applications needs SWT Jars in classpath. That is, they are supposed to run
without Eclipse Runtime.

I suggest you first go through SWT articles at SWT home page http://www.eclipse.org/swt/eclipse.php
Have a look at snippets http://www.eclipse.org/swt/snippets/ and example
http://www.eclipse.org/swt/examples.php before you proceed.


hth,
--
Ankur..
Eclipse PDE UI Committer | IBM India Software Lab, Bangalore
+91-99456-94011 | @ankur_sharma | http://blog.ankursharma.org
Previous Topic:Execute last launched app
Next Topic:PDE Build not working in command line
Goto Forum:
  


Current Time: Fri Mar 29 09:10:32 GMT 2024

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

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

Back to the top