Running eclipse.exe (octopus.exe) after maven tycho build does not start-up [message #1818697] |
Mon, 23 December 2019 18:11  |
Eclipse User |
|
|
|
The following tooling SW versions are used for my product (named octopus):
Java 13
JavaFX 13
Eclipse 2019-09
maven 3.6.3
tycho 1.5.1
I am developing an e(fx)clipse E4 RCP application featuring a test automation framework. I am using the recommended eclipse tycho folder structure and running the product with Eclipse IDE works fine. However, after successful maven-tycho build, running the application (octopus.exe) fails with the following exception:
Exception in Application start method
java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: java.lang.IllegalAccessError: class org.eclipse.fx.ui.workbench.fx.services.InteractiveStartupService (in unnamed module @0x331144b3) cannot access class com.sun.javafx.tk.Toolkit (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.tk to unnamed module @0x331144b3
at org.eclipse.fx.ui.workbench.fx.services.InteractiveStartupService.show(InteractiveStartupService.java:61)
at org.octopus.ui.application.OctopusStartupProgressTracker.stateReached(OctopusStartupProgressTracker.java:45)
at org.eclipse.fx.ui.workbench.fx.E4Application.updateStartupState(E4Application.java:447)
at org.eclipse.fx.ui.workbench.fx.E4Application.jfxStart(E4Application.java:226)
at org.eclipse.fx.ui.workbench.fx.DefaultJFXApp.start(DefaultJFXApp.java:60)
at org.eclipse.fx.ui.workbench.fx.E4MainThreadApplication$ExtendedE4Application.start(E4MainThreadApplication.java:101)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
... 1 more
The exception shows that the unnamed bundle (my octopus application bundle) cannot access type 'com.sun.javafx.tk.Tooljit' because
the module javafx.graphics does not export package 'com.sun.javafx.tk' to the unnamed bundle.
How can this restriction be resolved? How can the 'com.sun.javafx.tk' javafx package get exported to my unamed bundle? I tried to fix it
with all kinds of '--add-exports' '--add-reads' and '--add-modules' vmargs in the octopus.ini, however, without success.
It looks like that these arguments are ignored by the native e(fx)clipse launcher.
I use the type Toolkit in order to synchronize my splash screen and turn it into a startup-dialog. By means of the StartupProgressTrackerService
the splash is hidden and replaced by the startup-dialog.
See uploaded files for parent pom.xml, product.xml, target.xml, generated octopus.ini and config.in.
I am looking for a solution for days . I would appriciate it very much when somebody could help.
|
|
|
|
Re: Running eclipse.exe (octopus.exe) after maven tycho build does not start-up [message #1819617 is a reply to message #1819191] |
Sat, 18 January 2020 14:56   |
Eclipse User |
|
|
|
Thank you Tom for the reply!
No, i did not create a custum JDK with jlink. Actually, i dont know how to create a custom JDK with jlink.
Besides Java, I simply installed JavaFX under C:\Program Files\JavaFX\javafx-sdk-13.0.1. I thought i can post/ship the JavaFX API via the --module-path "C:\Program Files\JavaFX\javafx-sdk-13.0.1\lib" option (and other java module options) in octopus.ini at octopus application startup..
Do i have to define a certain environment variable (like JAVAFX_HOME)?
Or, is a custom JDK with jlink (i guess a jlink to the JavaFX API) the only way to solve my problem?
Another question: What are the javafx <extraClasspathElement>s in the 'tycho-compiler-plugin' used for? I guess, they are just required to get the product compiler-clean.
Thanks again!
|
|
|
Re: Running eclipse.exe (octopus.exe) after maven tycho build does not start-up [message #1821420 is a reply to message #1819617] |
Wed, 12 February 2020 19:27   |
Eclipse User |
|
|
|
We are actually migrating our e(fx)clipse application to openJDK11 & openJFX11. Ran into several similar issues. Please see the attached files (I renamed them to eclipse_man.ini and eclipse_org.ini, resp) which work for us (openJDK11 is located under "C:\Program Files\Java\jdk-11.0.6+10", openJFX11 is located under "C:\Program Files\Java\javafx-sdk-11.0.2"). Also note that NO Windows environment variables are needed for this, at all. The eclipse launcher takes all params correctly from the "eclipse_man.ini" file if the content is correct.
BUT I have to admit that our "eclipse_man.ini" file is currently created MANUALLY due to several issues:
(1) Somehow during the build all spaces and slashes in the "--module-path" declaration are wiped (so when declaring "C:\Program Files\Java..." as VM argument in the RCP product configuration, we unfortunately get "C:ProgramFilesJava..." in the eclipse_org.ini).
(2) It seems like there is currently no way for declaring the JDK path (i.e. "-vm" parameter) via product configuration (we would like to specify the exact JDK path for each of our application releases so that e.g. different versions can be used in parallel).
Due to these issues, we currently take the "eclipse_org.ini" (original output from the Tycho build) and have to adapt it to "eclipse_man.ini" (which can then successfully start our application).
Hope this helps a bit.
[Updated on: Wed, 12 February 2020 19:33] by Moderator Report message to a moderator
|
|
|
|
|
Re: Running eclipse.exe (octopus.exe) after maven tycho build does not start-up [message #1821933 is a reply to message #1821905] |
Sun, 23 February 2020 14:41  |
Eclipse User |
|
|
|
Glad to hear that it worked!
BTW: We found a way to "automate" the overwriting of the original Tycho output "ini" file with our own, adapted file. It was realized by means of the "maven-antrun-plugin".
The attached pom.xml from our product plugin does two simple steps in the course of the Tycho build:
(1) Extract the Tycho output (zip archive)
(2) Overwrite the original "ini" file with the adapted one from our workspace
Hope this helps.
Attachment: pom.xml
(Size: 3.00KB, Downloaded 136 times)
[Updated on: Sun, 23 February 2020 14:41] by Moderator Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04168 seconds