Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Re: How to use launcher.jar in 3.3.0-M7?



> "Steven E. Harris" <seh@xxxxxxxxx> writes:
>
> > I noticed that if I just call
> >
> >   java -jar org.eclipse.equinox.launcher_1.0.0.v20070502.jar
> >
> > or try to start it up in the debugger using
> > org.eclipse.osgi.framework.launcher as the main class, initialization
> > fails because none of the locations get initialized properly:
>


I get a different error than you when I try this

java.lang.RuntimeException: Could not find framework
        at org.eclipse.equinox.launcher.Main.getBootPath(Main.java:805)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:420)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1162)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1137)

This is because as you have noted below the equinox.launcher must be located
in a "plugins" directory and co-located with org.eclipse.osgi.  This seems
like an arbitrary restriction.  I opened a bug to track this
https://bugs.eclipse.org/bugs/show_bug.cgi?id=186151

> Well, I figured out that if I rearranged my files with the following
> layout, things sort of work as expected:
>
>   plugins/
>     org.eclipse.equinox.launcher_1.0.0.v20070502.jar
>     org.eclipse.osgi
>     ...
>
>   configuration/
>     config.ini
>
>
> But that differs from the layout that EclipseStarter seems to expect
> when I start it embedded-style from my own launcher program:
>
>   any-directory/
>     org.eclipse.osgi
>     ...
>     configuration/
>       config.ini
>
>
> That is, in "embedded mode", as I'll call it, all that matters is that
> the "configuration" directory sits below the directory where the
> org.eclipse.osgi bundle sits.
>
> With the launcher JAR, the Equinox bundles must be in a directory
> called "plugins" with the "configuration" directory as a sibling
> rather than a child.
>
> Why the difference?


The equinox.launcher is typically used to launch RCP type applications.
RCP applications have historically used the following directory structure

  plugins/
   org.eclipse.equinox.launcher_1.0.0.v20070502.jar
   org.eclipse.osgi
   ...
 configuration/
   config.ini


With that said I'm not sure the equinox.launcher is well suited for the
embedded usecase anyway.  The equinox.launcher sets up its own classloader
for the osgi framework which will be inaccessible from your "outer"
application which is embedding equinox.  By default the framework
classloader created by equinox.launcher uses the boot classloader as
its parent so it will be completely disconnected from your applications
classloader.

Tom.

>
> --
> Steven E. Harris
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev

Back to the top