Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Upgrading e(fx)clipse plugin based app to OpenJDK and OpenJFX(Having issues getting javafx.swt module included and visible in product)
Upgrading e(fx)clipse plugin based app to OpenJDK and OpenJFX [message #1823514] Fri, 27 March 2020 21:57 Go to next message
Jim Klo is currently offline Jim KloFriend
Messages: 49
Registered: September 2012
Member
We are in the process of updating an app we originally developed under Oracle Java and JavaFX. This app is plug-in based versus feature based. The app is composed of about 10 plug-ins, only one has a JavaFX UI. We target the distribution for macOS, Windows, and occasionally Linux..

Anyways, we started down the path of getting the whole application updated to use Eclipse 2020-01 and JDK 13. We now have the app updated and working minus the JFX enabled plugin (however our tycho build is another problem, but we can sort that out later).

Now we are trying to tackle the JFX plug-in. One of the issues I'm running into is the javafx.swt module. Not sure what the best way to bring this into the project as it's platform dependent.

I found Tom Schindl's blog post here which describes the basic process. https://tomsondev.bestsolution.at/2020/01/28/setting-up-efxclipse-rcp-development-for-java11-and-pde/

The one sticky point is I'm not quite sure how to leverage the p2 repository for for OpenJFX 11 that Tom has hosted at bestsolution.at. When I add the modules into the Target Platform, the JAR files seem to get bundled, however only as files, not as libraries, so none of the classes seem to be imported into the platform. Added these modules as plug-in dependencies adds the files into the plug-in's library References, however when I dig into the library, all I see is the raw OpenJFX jar file and none of the classes.

So I'm unclear how to get OpenJFX, specifically the javafx.swt, which is platform dependent into the build. Ideally I'd like to use the latest OpenJFX, but can use OpenJFX 11 if that's all that works.

Thanks for any advice.
Re: Upgrading e(fx)clipse plugin based app to OpenJDK and OpenJFX [message #1823517 is a reply to message #1823514] Fri, 27 March 2020 23:17 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6559
Registered: July 2009
Senior Member
So we are talking about compile time problems right? The compile problems in Eclipse are solved by the installation of the efxclipse plugins and pointing to the openjfx-sdk lib folder. If you use our rebundled openjfx libs there are no package import/require bundle is needed. At runtime efxclipse-osgi will spin up a jpms-layer and installs the rebundled java-modules. So those osgi bundles are pure deployment artifacts hence they do not export any packages.
Re: Upgrading e(fx)clipse plugin based app to OpenJDK and OpenJFX [message #1823518 is a reply to message #1823517] Sat, 28 March 2020 00:32 Go to previous messageGo to next message
Jim Klo is currently offline Jim KloFriend
Messages: 49
Registered: September 2012
Member
It's a problem with both, I think.

I have 3 scenarios:

1. Development and Debugging - I need to have OpenJFX classes available as a library. I have multiple developers on different platforms - I really just want them to be able to checkout the source and be able to start building. Having to fiddle with a bunch of Java and Maven dependencies always causes issues.
2. CI/CD - our Jenkins system needs to be able to compile, test, and package. Using tycho currently - but probably needs to be completely revamped.
3. Deployment: end users need minimal prerequisites and configuration to install.

I guess what I'm confused by is if I'm using the target platform that contains the JavaFX dependencies, why aren't the classes just exported like every other plug-in. What I'm missing is how the rebundled openjfx libs end up on the classpath, because those should show up since they are part of the target platform, and resolve, but I don't see that happening.

index.php/fa/37680/0/

index.php/fa/37681/0/

index.php/fa/37682/0/

index.php/fa/37683/0/



Re: Upgrading e(fx)clipse plugin based app to OpenJDK and OpenJFX [message #1823532 is a reply to message #1823518] Sat, 28 March 2020 12:23 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6559
Registered: July 2009
Senior Member
On 1:
I repeat thos dependencies are useless for compilation - they are only needed at runtime and end up at the classpath with the adaptor hook we provide who steps into the classloading delegation (https://github.com/eclipse-efx/efxclipse-rt/blob/master/modules/core/org.eclipse.fx.osgi/src/main/java/org/eclipse/fx/osgi/fxloader/FXClassLoader.java) - so please remove
the require-bundle directives in your code - you did not answer my question:
* Did you set the preferences to point to a download JavaFX-SDK? - https://tomsondev.files.wordpress.com/2020/01/bildschirmfoto-2020-01-28-um-13.10.44.png?w=1280&h=944
* What EE have you set in your project and did you update the .classpath to use that profile - https://tomsondev.files.wordpress.com/2020/01/bildschirmfoto-2020-01-28-um-13.27.01.png?w=1280&h=1182

on 2: Tycho is perfectly fine - see what you need to change to do https://tomsondev.files.wordpress.com/2020/01/bildschirmfoto-2020-01-28-um-14.45.50.png?w=1280&h=978
on 3: This is what the bundled openjfx binaries are for you ONLY have them in your target to ship JavaFX to your customers - I repeat they don't export any JavaFX classes - JavaFX MUST run as an JPMS-Module hence the trick happening inside our adaptor hook to spin up dynamic JPMS-Layer containing them

On 2:
Re: Upgrading e(fx)clipse plugin based app to OpenJDK and OpenJFX [message #1823564 is a reply to message #1823532] Sun, 29 March 2020 04:26 Go to previous messageGo to next message
Jim Klo is currently offline Jim KloFriend
Messages: 49
Registered: September 2012
Member
regarding JFX-SDK: index.php/fa/37690/0/

as far as EE, not sure what you mean...
index.php/fa/37689/0/
index.php/fa/37688/0/

I'm not sure how to get the javafx libraries to show up on the classpath. When I go configure the classpath.... There's nothing to select in the JavaFX Library:index.php/fa/37687/0/

The only way I can get them somewhat on the classpath is by adding them as an external jar, but I don't think that's what I want. I'm thinking they should show up under "Plug-in Dependencies" and not "Referenced Libraries".

[Updated on: Sun, 29 March 2020 04:35]

Report message to a moderator

Re: Upgrading e(fx)clipse plugin based app to OpenJDK and OpenJFX [message #1823659 is a reply to message #1823564] Mon, 30 March 2020 20:20 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6559
Registered: July 2009
Senior Member
Ok this looks like a bug in the tooling - https://github.com/eclipse-efx/efxclipse-eclipse/issues/73 if I set the EE (Execution Environment) to 11 then it works if I set it 13 then it fails
Previous Topic:Simple e4 fx application wont start up
Next Topic:Problem with using Java 11 on Mac
Goto Forum:
  


Current Time: Fri Jul 10 04:03:04 GMT 2020

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

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

Back to the top