Home » Eclipse Projects » e(fx)clipse » How to startup efxclipse RCP application via EclipseStarter programmatically?
| | |
Re: How to startup efxclipse RCP application via EclipseStarter programmatically? [message #1592719 is a reply to message #1591453] |
Fri, 30 January 2015 07:23 |
Claus Klammer Messages: 12 Registered: March 2012 |
Junior Member |
|
|
Thank you Tom for your fast response. Unfortunately neither of your suggested soltions work. I will now take a look at the differences between starting with EclipseStarter and the launcher Main. Do you have any additional suggestions? (see my bootstrapping code below, which is called from the main class constructor
new Thread() {
@Override
public void run() {
initializeEclipseStarter();
String[] equinoxArgs = {"org.osgi.framework.bundle.parent", "ext", "-console", "-consoleLog", "-debug", "debug_options", "-org.osgi.framework.bundle.parent", "ext", "-data", "D:/projects/AutoTest/Keba/_out/eclipse/"};
try {
EclipseStarter.main(equinoxArgs);
} catch (Exception e) {
throw new RuntimeException("Starting OSGI failed!", e);
}
}
}.start();
while (!EclipseStarter.isRunning()) {
Thread.sleep(1000);
}
............
private void initializeEclipseStarter() {
Map<String, String> initProps = new HashMap<String, String>();
initProps.put("osgi.syspath", myExportedApplicationLocation+"plugins");
initProps.put("osgi.install.area", myExportedApplicationLocation);
initProps.put("org.osgi.framework.bundle.parent", "ext");
EclipseStarter.setInitialProperties(initProps);
}
[Updated on: Fri, 30 January 2015 07:24] Report message to a moderator
|
|
| |
Re: How to startup efxclipse RCP application via EclipseStarter programmatically? [message #1592739 is a reply to message #1592719] |
Fri, 30 January 2015 07:38 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
You are using it wrong! -D needs to be passed to the launch process!
so you should launch the VM with
java -jar .... -Dorg.osgi.framework.bundle.parent=ext both parameters I
gave you are should result in the system properties.
You could also try to set the directly in code using System.getProperties()!
Tom
On 30.01.15 08:23, Claus Klammer wrote:
> Thank you Tom for your fast response. Unfortunately neither of your
> suggested soltions work. I will not take a look at the differences
> between starting with EclipseStarter and the launcher Main. Do you have
> any additional suggestions? (see my bootstrapping code below, which is
> called from the main class constructor
>
> new Thread() {
> @Override
> public void run() {
> initializeEclipseStarter();
> String[] equinoxArgs =
> {"org.osgi.framework.bundle.parent", "ext", "-console", "-consoleLog",
> "-debug", "debug_options", "-org.osgi.framework.bundle.parent", "ext",
> "-data", "D:/projects/AutoTest/Keba/_out/eclipse/"};
> try {
> EclipseStarter.main(equinoxArgs);
> } catch (Exception e) {
> throw new RuntimeException("Starting OSGI failed!", e);
> }
> }
> }.start();
>
> while (!EclipseStarter.isRunning()) {
> Thread.sleep(1000);
> }
> ............
>
> private void initializeEclipseStarter() {
> Map<String, String> initProps = new HashMap<String, String>();
> initProps.put("osgi.syspath",
> myExportedApplicationLocation+"plugins");
> initProps.put("osgi.install.area", myExportedApplicationLocation);
> initProps.put("org.osgi.framework.bundle.parent", "ext");
>
> EclipseStarter.setInitialProperties(initProps);
> }
>
|
|
| | |
Re: How to startup efxclipse RCP application via EclipseStarter programmatically? [message #1592924 is a reply to message #1592881] |
Fri, 30 January 2015 10:04 |
Claus Klammer Messages: 12 Registered: March 2012 |
Junior Member |
|
|
Yes, I use the configuration directory of the exported application.
Did you use the EclipseStarter, too? Documentation (launcher.Main) says that EclipseStarter should be used when started from java.
Excuse me, but I do not understand your comment "but I thing more done than to call"
Thomas Schindl wrote on Fri, 30 January 2015 04:25Yes I have because I had make an OSGi-Application starting as a
(Windows)Service-Daemon but I thing more done than to call
org.eclipse.equinox.launcher.Main.main(String[]) are you also using a
"configuration" directory?
Tom
On 30.01.15 10:10, Claus Klammer wrote:
> I tried it also this way because setting it via SystemProperties (also
> programmatically) did not work for me - sorry for the confusion. I am
> currently investigating the org.eclipse.equinox.launcher.Main and the
> StartupClassLoader. But I've to admit that I did not find out so far,
> how this all fits together. Do you know of any documentation which
> describes the different launching strategies, and use cases of
> equinox.launcher Main and EclipseStarter and why we need a special
> classloading mechanism (extension feature only available when launched
> throw launcher.Main?)?
>
> Have you ever sucessfully started an e4 fx RCP application
> programmatically within another java program? If yes, could you provide
> an example project - I would appreciate it very much.
>
> Any other hints, or links to documentation of this classloading problems
> that help me for better understanding the problem are most welcome.
>
|
|
|
Re: How to startup efxclipse RCP application via EclipseStarter programmatically? [message #1592979 is a reply to message #1592924] |
Fri, 30 January 2015 10:41 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
My code looks like this (in reality it is a bit more involved because
I'm looking up the equinox.launcher and create an URLClassloader)
class MyClass {
private static String[] origArgs;
public static void main(String[] args) {
origArgs = args;
// .....
}
public void launch() {
...launcher.Main.launch(origArgs);
}
}
Can you post the content of your config.ini?
Tom
On 30.01.15 11:04, Claus Klammer wrote:
> Yes, I use the configuration directory of the exported application.
> Did you use the EclipseStarter, too? Documentation (launcher.Main) says
> that EclipseStarter should be used when started from java.
>
> Excuse me, but I do not understand your comment "but I thing more done
> than to call"
>
> Thomas Schindl wrote on Fri, 30 January 2015 04:25
>> Yes I have because I had make an OSGi-Application starting as a
>> (Windows)Service-Daemon but I thing more done than to call
>>
>> org.eclipse.equinox.launcher.Main.main(String[]) are you also using a
>> "configuration" directory?
>>
>> Tom
>>
>> On 30.01.15 10:10, Claus Klammer wrote:
>> > I tried it also this way because setting it via SystemProperties (also
>> > programmatically) did not work for me - sorry for the confusion. I am
>> > currently investigating the org.eclipse.equinox.launcher.Main and the
>> > StartupClassLoader. But I've to admit that I did not find out so far,
>> > how this all fits together. Do you know of any documentation which
>> > describes the different launching strategies, and use cases of
>> > equinox.launcher Main and EclipseStarter and why we need a special
>> > classloading mechanism (extension feature only available when launched
>> > throw launcher.Main?)?
>> > > Have you ever sucessfully started an e4 fx RCP application
>> > programmatically within another java program? If yes, could you provide
>> > an example project - I would appreciate it very much.
>> > > Any other hints, or links to documentation of this classloading
>> problems
>> > that help me for better understanding the problem are most welcome.
>> >
>
>
|
|
| | | | |
Re: How to startup efxclipse RCP application via EclipseStarter programmatically? [message #1593694 is a reply to message #1593413] |
Fri, 30 January 2015 20:49 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Hi,
Let's start with Equinox and its classloading which behaves a bit
strange because when it does classloading it simply skips the extension
classpath hence it won't find stuff on that classpath like JavaFX.
The "ext" setting I told you fixes this and makes Equinox behave like
any normal java app including Apache Felix.
In Java7 which we still support e.g. because of STS depending on it the
situation is a bit different because JavaFX is on NO classpath at all
hence even putting Equinox into the "ext" mode would not help,
additionally we can not rely on the "ext" mode when writing Eclipse IDE
plugins who use JavaFX because:
a) we can not simply reconfigure without potentially breaking old bundles
b) we can not do it because the SWT integration still is on no classpath
My comment was that once we can get rid of this stuff we could ditch the
hook stuff completely - my plan is to go down this route once we start
working on Java9 which anyways has jigsaw and everything is a module
anyways ;-)
Tom
On Java7 JavaFX is not on any classpath at all - so no matter what
On 30.01.15 17:22, Claus Klammer wrote:
> Since I am curious (related to your statments see below), could you
> please elaborate in more detail about the implications of the Java7
> support.
> As far as I understand, these problems ("ext" thing) exist because Java7
> does not come with built-in JavaFX support, am I right? How would
> efxclipse differ, if Java7 support could be dismissed?
>
> Quote:
>> I really hope that one day Equinox will make the "ext" setting the
>> default and which would make the fake bundle, the imports, ... needless.
>>
>> In applications who use Nashorn I'm running today already with this
>> setting we currently only keep the hook stuff because of Java7 / RCP and
>> the IDE where we can't simply change this setting.
>
|
|
|
Goto Forum:
Current Time: Wed Feb 05 15:51:49 GMT 2025
Powered by FUDForum. Page generated in 0.05805 seconds
|