Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » ClassNotFoundException when running Java application inside PDE project
ClassNotFoundException when running Java application inside PDE project [message #64201] Sat, 06 June 2009 23:23 Go to next message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
Occassionally when I am working on a plug-in, I will hack together a quick
class with a main method and run it from inside the project. I do this
especially to test little SWT or JFace ideas. Usually this works fine and
the Java classpath has all the necessary jars. I tried this today on 3.5RC3
and I got a ClassNotFoundException.

The reason is that a transitive dependency was not available:

myplugin -> org.eclipse.core.databinding ->
org.eclipse.core.databinding.property

I totally agree that the transitive dependency should not be on the compile
time classpath, but why not on the runtime classpath? Maybe this was never
supposed to work, and I just got lucky in the past.

-Will
Re: ClassNotFoundException when running Java application inside PDE project [message #64327 is a reply to message #64201] Mon, 08 June 2009 19:29 Go to previous message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
I think I was just getting lucky. The same thing happens in 3.4, but it is
just less likely. The workaround I've found is to wrap the code in a JUnit
test and use the JUnit Plug-in test launch config coupled with the Headless
Application. This gives you the basic OSGi runtime and a simple entry point
(JUnit) to arbitrary code.

"Will Horn" <will.horn@gmail.com> wrote in message
news:h0etpd$puu$1@build.eclipse.org...
> Occassionally when I am working on a plug-in, I will hack together a quick
> class with a main method and run it from inside the project. I do this
> especially to test little SWT or JFace ideas. Usually this works fine and
> the Java classpath has all the necessary jars. I tried this today on
> 3.5RC3 and I got a ClassNotFoundException.
>
> The reason is that a transitive dependency was not available:
>
> myplugin -> org.eclipse.core.databinding ->
> org.eclipse.core.databinding.property
>
> I totally agree that the transitive dependency should not be on the
> compile time classpath, but why not on the runtime classpath? Maybe this
> was never supposed to work, and I just got lucky in the past.
>
> -Will
Re: ClassNotFoundException when running Java application inside PDE project [message #598158 is a reply to message #64201] Mon, 08 June 2009 19:29 Go to previous message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
I think I was just getting lucky. The same thing happens in 3.4, but it is
just less likely. The workaround I've found is to wrap the code in a JUnit
test and use the JUnit Plug-in test launch config coupled with the Headless
Application. This gives you the basic OSGi runtime and a simple entry point
(JUnit) to arbitrary code.

"Will Horn" <will.horn@gmail.com> wrote in message
news:h0etpd$puu$1@build.eclipse.org...
> Occassionally when I am working on a plug-in, I will hack together a quick
> class with a main method and run it from inside the project. I do this
> especially to test little SWT or JFace ideas. Usually this works fine and
> the Java classpath has all the necessary jars. I tried this today on
> 3.5RC3 and I got a ClassNotFoundException.
>
> The reason is that a transitive dependency was not available:
>
> myplugin -> org.eclipse.core.databinding ->
> org.eclipse.core.databinding.property
>
> I totally agree that the transitive dependency should not be on the
> compile time classpath, but why not on the runtime classpath? Maybe this
> was never supposed to work, and I just got lucky in the past.
>
> -Will
Previous Topic:Not getting Instance of IResource
Next Topic:Headless build problem with re-exported packages.
Goto Forum:
  


Current Time: Fri Apr 19 12:37:18 GMT 2024

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

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

Back to the top