ClassNotFoundException when running Java application inside PDE project [message #64201] |
Sat, 06 June 2009 19:23  |
Eclipse User |
|
|
|
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 15:29  |
Eclipse User |
|
|
|
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 15:29  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04875 seconds