Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » e(fx)clipse runtime works on JRE8 but not JRE7
e(fx)clipse runtime works on JRE8 but not JRE7 [message #1714944] Tue, 17 November 2015 19:41 Go to next message
Chris Hogan is currently offline Chris HoganFriend
Messages: 4
Registered: November 2015
Junior Member
We have an OSGi system that's an in-house UI framework and we are trying to start incorporating FX UIs using e(fx)clipse runtime jars. To get this to work we cobbled together alot of forum postings to come up with the following procedure

We have added the following jars (from our eclipse plugins directory) to the target platform:
org.eclipse.fx.javafx_2.2.0_201411050602.jar
org.eclipse.fx.osgi_1.1.0_2014110500602.jar

Then we upgraded to org.eclipse.osgi_3.10.100.v20150529-1857.jar to resolve a complaint that we are missing Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8 ))

We added -Dosgi.framework.extensions=org.eclipse.fx.osgi and -Dorg.osgi.framework.bundle.parent=ext

Any bundles that use FX code now have a dependency on the org.eclipse.fx.javafx plugin.

This setup was working fine in both dev and release environment (more on that in a second) under JRE8. Then we found out we had to go back to using JRE7, now it runs in our dev environment through eclipse, but when we try to run in release environment it fails with NoClassDefFoundErrors on all of the JavaFX dependencies from our bundles.

Our release environment is a bat file that runs the org.eclipse.osgi jar with a pointer to our config.ini file, and some command line switches for the framework hooks as described above. The config.ini contains the bundles we are launching, including the org.eclipse.fx.javafx.

When we examine things on the console it shows that OSGi integration for JavaFX is RESOLVED, and all of our bundles are marked as ACTIVE including the "Fake bundle for Javafx" and all of our bundles that depend on it (i.e. have Require-Bundle set to include org.eclipse.fx.javafx). But as soon as we hit the point in the code where it needs JavaFX classes we get the NoClassDefFoundErrors.

I'm wondering if maybe it's the version of the e(fx)clipse runtime I'm using that just doesn't support JRE7? Or is there some part of the configuration I'm missing? I don't understand why the e(fx)clipse runtime bundles seem to load fine but the dependency isn't found, Not to mention why it seems to work running in eclipse, and under JRE8 but not outside eclipse in JRE7.

I'd really appreciate some help here. Thanks!
Re: e(fx)clipse runtime works on JRE8 but not JRE7 [message #1714957 is a reply to message #1714944] Tue, 17 November 2015 22:29 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

a) do you require FXCanvas?

b) -Dorg.osgi.framework.bundle.parent=ext has no effect on Java7
because JavaFX is not on a classpath at all

c) if you run on Equinox 3.10 the 1.1.0 hooks can not work as the API
has changed so you need the 2.2.0 adapter hooks

d) if you run with the 2.2.0 adapter hooks you
- should remove org.eclipse.fx.javafx from your target it is not
required anymore

- you have to remove package imports/require bundles to javafx.* and
org.eclipse.fx.javafx as well

e) it is an absolute must that the adapter-hook and osgi.jar at
physically next to each other

f) you can debug the adapter hook with -Defxclipse.osgi.hook.debug=true

Tom

On 17.11.15 22:37, Chris Hogan wrote:
> We have an OSGi system that's an in-house UI framework and we are trying
> to start incorporating FX UIs using e(fx)clipse runtime jars. To get
> this to work we cobbled together alot of forum postings to come up with
> the following procedure
>
> We have added the following jars (from our eclipse plugins directory) to
> the target platform:
> org.eclipse.fx.javafx_2.2.0_201411050602.jar
> org.eclipse.fx.osgi_1.1.0_2014110500602.jar
>
> Then we upgraded to org.eclipse.osgi_3.10.100.v20150529-1857.jar to
> resolve a complaint that we are missing Require-Capability: osgi.ee;
> filter="(&(osgi.ee=JavaSE)(version=1.8 ))
>
> We added -Dosgi.framework.extensions=org.eclipse.fx.osgi and
> -Dorg.osgi.framework.bundle.parent=ext
>
> Any bundles that use FX code now have a dependency on the
> org.eclipse.fx.javafx plugin.
>
> This setup was working fine in both dev and release environment (more on
> that in a second) under JRE8. Then we found out we had to go back to
> using JRE7, now it runs in our dev environment through eclipse, but when
> we try to run in release environment it fails with NoClassDefFoundErrors
> on all of the JavaFX dependencies from our bundles.
>
> Our release environment is a bat file that runs the org.eclipse.osgi jar
> with a pointer to our config.ini file, and some command line switches
> for the framework hooks as described above. The config.ini contains the
> bundles we are launching, including the org.eclipse.fx.javafx.
>
> When we examine things on the console it shows that OSGi integration for
> JavaFX is RESOLVED, and all of our bundles are marked as ACTIVE
> including the "Fake bundle for Javafx" and all of our bundles that
> depend on it (i.e. have Require-Bundle set to include
> org.eclipse.fx.javafx). But as soon as we hit the point in the code
> where it needs JavaFX classes we get the NoClassDefFoundErrors.
>
> I'm wondering if maybe it's the version of the e(fx)clipse runtime I'm
> using that just doesn't support JRE7? Or is there some part of the
> configuration I'm missing? I don't understand why the e(fx)clipse
> runtime bundles seem to load fine but the dependency isn't found, Not to
> mention why it seems to work running in eclipse, and under JRE8 but not
> outside eclipse in JRE7.
>
> I'd really appreciate some help here. Thanks!
Re: e(fx)clipse runtime works on JRE8 but not JRE7 [message #1715064 is a reply to message #1714957] Wed, 18 November 2015 22:44 Go to previous messageGo to next message
Chris Hogan is currently offline Chris HoganFriend
Messages: 4
Registered: November 2015
Junior Member
Tom,

Thanks so much for your reply, and I apologize in advance for any stupid questions I may ask, as I haven't been working in OSGi very long.

a) No FXCanvas, I'm not using any SWT stuff, just swing, so my integration is through JFXPanels

b) Very good to know, thank you! So there should be no value set for the org.osgi.framework.bundle.parent option, I'll remove those.

c) Where can I get the 2.2.0 adapter hook? The releases are only up to 2.1.0 from what I can see and I'm not sure how to build the main git project to produce a plugin. Where can I get a 2.2.0 target platform?

More to the point, I don't have anything forcing me to keep using 3.10 (I think we went forward to that one because we were originally using JDK8 and that's what Mars was using, which had better JDK8 integration or something), so if I were to go back to Luna or some other version of eclipse, is there a list somewhere of which adapter hook versions are compatible with which versions of org.eclipse.osgi?

d) Does this only apply for 2.2.0+ or would this apply to the 2.1.0 adapter hook?

e) I've definitely been doing this.

f) I have seen that in a few different threads around the web but I have yet to get it to work....what should I be looking for in the output to indicate that switch is working? And is there anything required to get it to work other than just adding it to the command line?

Finally, one question for you. I came across a stackoverflow (not allowed to link to it yet, but the title is "e(fx)clipse 0.9.0 on Kepler with Java 7") where you said what I interpreted to mean that newer versions (i.e. 0.9.0+) required Java8. That's why at one point I started trying to find a combination that would work with 0.9.0...did I misinterpret that? I should be able to get any version of the efxclipse runtime to work with JRE7 right?



Thanks again!

[Updated on: Thu, 19 November 2015 01:33]

Report message to a moderator

Re: e(fx)clipse runtime works on JRE8 but not JRE7 [message #1715074 is a reply to message #1715064] Thu, 19 November 2015 00:01 Go to previous messageGo to next message
Chris Hogan is currently offline Chris HoganFriend
Messages: 4
Registered: November 2015
Junior Member
Quick update, I found that I could get a copy of efxclipse 2.2 from downloads.efxclipse.bestsolution.at/downloads/nightly/sdk/

When I try to open it on a machine without Java8 I get an error that JavaFX features are disabled because because they require Java8. I don't know if it will be ok or not.

I tried ignoring that error and opening up my project, removing org.eclipse.fx.javafx from the target platform, and started removing all of my bundle dependencies on it. I have the org.eclipse.fx.osgi v 2.2.0 and org.eclipse.osgi v 3.10.100 in my target platform, and it's also in the eclipse/plugins directory. I also have -Dosgi.framework.extensions=org.eclipse.fx.osgi in the arguments tab of my eclipse run configuration (essentially the config.ini) and just to be safe I also added it to the Arguments tab of the target platform dialog.

Doing this, eclipse still gives me errors in all of the source files that reference javafx namespace classes. Am I missing some step to make eclipse see the FX classes? I'm working with JDK7 u40 if that matters.
Re: e(fx)clipse runtime works on JRE8 but not JRE7 [message #1715102 is a reply to message #1715074] Thu, 19 November 2015 09:19 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

2.1.0 should be fine as well. The adapter hooks only require Java7 so
they work everywhere. It's only the other parts of e(fx)clipse that
require Java8.

I'd stay with 3.10.

Is the e(fx)clipse tooling installed?

Tom

On 19.11.15 01:01, Chris Hogan wrote:
> Quick update, I found that I could get a copy of efxclipse 2.2 from
> downloads.efxclipse.bestsolution.at/downloads/nightly/sdk/
>
> When I try to open it on a machine without Java8 I get an error that
> JavaFX features are disabled because because they require Java8. I don't
> know if it will be ok or not.
>
> I tried ignoring that error and opening up my project, removing
> org.eclipse.fx.javafx from the target platform, and started removing all
> of my bundle dependencies on it. I have the org.eclipse.fx.osgi v 2.2.0
> and org.eclipse.osgi v 3.10.100 in my target platform, and it's also in
> the eclipse/plugins directory. I also have
> -Dosgi.framework.extensions=org.eclipse.fx.osgi in the arguments tab of
> my eclipse run configuration (essentially the config.ini) and just to be
> safe I also added it to the Arguments tab of the target platform dialog.
>
> Doing this, eclipse still gives me errors in all of the source files
> that reference javafx namespace classes. Am I missing some step to make
> eclipse see the FX classes? I'm working with JDK7 u40 if that matters.
Re: e(fx)clipse runtime works on JRE8 but not JRE7 [message #1715103 is a reply to message #1715074] Thu, 19 November 2015 09:24 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Can you add post the output with -Defxclipse.osgi.hook.debug=true and
post the log output.

Tom

On 19.11.15 01:01, Chris Hogan wrote:
> Quick update, I found that I could get a copy of efxclipse 2.2 from
> downloads.efxclipse.bestsolution.at/downloads/nightly/sdk/
>
> When I try to open it on a machine without Java8 I get an error that
> JavaFX features are disabled because because they require Java8. I don't
> know if it will be ok or not.
>
> I tried ignoring that error and opening up my project, removing
> org.eclipse.fx.javafx from the target platform, and started removing all
> of my bundle dependencies on it. I have the org.eclipse.fx.osgi v 2.2.0
> and org.eclipse.osgi v 3.10.100 in my target platform, and it's also in
> the eclipse/plugins directory. I also have
> -Dosgi.framework.extensions=org.eclipse.fx.osgi in the arguments tab of
> my eclipse run configuration (essentially the config.ini) and just to be
> safe I also added it to the Arguments tab of the target platform dialog.
>
> Doing this, eclipse still gives me errors in all of the source files
> that reference javafx namespace classes. Am I missing some step to make
> eclipse see the FX classes? I'm working with JDK7 u40 if that matters.
Re: e(fx)clipse runtime works on JRE8 but not JRE7 [message #1715182 is a reply to message #1715103] Thu, 19 November 2015 20:55 Go to previous message
Chris Hogan is currently offline Chris HoganFriend
Messages: 4
Registered: November 2015
Junior Member
Unfortunately I can't post any logs from this program. As I said I also can't seem to get the -Defxclipse.osgi.hook.debug=true flag to print anything, I'm not sure why.

On the bright side I think I've resolved the problem. We had been using a command line similar to the following to launch our software
java -jar org.eclipse.osgi.jar

(The default entrypoint for the framework jar is the EclipseStarter) and that seemed to be ignoring the extensions parameter or something (e.g. even with -verbose flag set I couldn't see anything about the FXClassLoader in the logs)

I noticed that the command line eclipse was using to start the application was something along the lines of this
java -classpath <org.eclipse.equinox.launcher.jar> org.eclipse.equinox.launcher.Main

So I edited the run.bat to use the equinox launcher rather than the EclipseStarter and that seems to have resolved my issue.

In the process of trying to figure out what to do I came across another forum thread in which the poster seems to have run across this same issue (and I think found a way to skirt the issue if I follow correctly). Anyway it seems like the EclipseStarter may be ignoring some of the command line switches that the Equinox Launcher is not.

https://www.eclipse.org/forums/index.php/t/970283/

Hopefully this all made sense. Thanks again for your prompt replies, you've been most helpful!
Previous Topic:Error running Tutorial 2 / JavaFX Viewpart
Next Topic:Application model variables not declared as modifiable
Goto Forum:
  


Current Time: Thu Mar 28 21:16:54 GMT 2024

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

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

Back to the top