Access JavaFX from a eclipse plug-in code in Java 8 [message #1794970] |
Tue, 11 September 2018 17:16  |
Eclipse User |
|
|
|
I am trying to use JavaFX package in a Java 8 code from eclipse plug-in. I was able to compile it, but at run-time the plug-in is not able get JavaFX class loaded. Looks like, OSGi Plug-in is not able load classes from "[JAVA]\jre\lib\ext\" directory, but able to load classes from "[JAVA]\jre\lib\".
I couldn't import javafx packages from imported packages as well. I think, I am missing something in OSGi class loading.
Any pointers how to resolve the issue is highly appreciated.
** I understand there is a way by including e(fx)clipse or copying jfxrt.jar to the plug-in class-path will resolve the issue, but I wanted to know why plug-in is not able to load from /ext/ path of the JRE.
|
|
|
Re: Access JavaFX from a eclipse plug-in code in Java 8 [message #1795051 is a reply to message #1794970] |
Thu, 13 September 2018 11:10  |
Eclipse User |
|
|
|
Following is the way, we fixed the issue.
Just to add more details regarding the solution,
The following are the OSGi configuration properties.
org.osgi.framework.bundle.parent - Specifies which class loader is used for boot delegation. Possible values are: boot for the boot class loader, app for the application class loader, ext for the extension class loader, and framework for the framework's class loader. The default is boot.
org.osgi.framework.system.packages - Specifies a comma-delimited list of packages that should be exported via the System Bundle from the framework class loader. The framework will set this to a reasonable default. If the value is specified, it replaces any default value.
So by adding -Dorg.osgi.framework.bundle.parent=ext -Dorg.osgi.framework.system.packages.extra=javafx.* the VM args, it added required dependency.
|
|
|
Powered by
FUDForum. Page generated in 1.05955 seconds