John Brice created NETBEANS-1786:
------------------------------------
Summary: Unable to run/debug an OpenJFX project with a dedicated
libraries folder
Key: NETBEANS-1786
URL: https://issues.apache.org/jira/browse/NETBEANS-1786
Project: NetBeans
Issue Type: Bug
Affects Versions: 10.0
Environment: Windows 10 1803 (64-bit)
Netbeans 10vc4
AdoptOpenJDK 11.0.1
OpenJFX 11.0.1
Reporter: John Brice
JavaFX project runs/debugs successfully in NetBeans unless the project has a
dedicated library folder, then JavaFX fails to initialise.
Create a library for JavaFX (OpenJFX 11.0.1).
Create a normal Java Application, name _Test4_, deselect _Use Dedicated Folder
for Storing Libraries_, accept all other defaults.
Overwrite default Test4 class with this:
{code:java}
package test4;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
public class Test4 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
Platform.runLater(() -> {
System.err.println("*** exiting");
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
Platform.exit();
System.exit(0);
});
}
}
{code}
Add your library to the modulepath.
Add the OpenJFX jar files to the classpath.
Add --module-path %PATH_TO_FX% and --add-modules javafx.controls,javafx.fxml to
VM options.
This project should successfully run/debug (all it does is print a message and
exit).
Setting a dedicated libraries folder (project properties > Libraries > Browse)
then importing the OpenJFX library, (or selecting _Use Dedicated Folder for
Storing Libraries_ during project creation) causes the project to fail with
{noformat}
Graphics Device initialization failed for : d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing
QuantumRenderer: no suitable pipeline found
at
javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at
javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:222)
at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
at
javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at
javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at
javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at
javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at
javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at
java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no
suitable pipeline found
at
javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at
javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:834)
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at
java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: No toolkit found
at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
at
javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at
javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at
javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at
javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at
javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
... 5 more
C:\Users\fgbjbri\AppData\Local\NetBeans\Cache\10.0\executor-snippets\debug.xml:150:
The following error occurred while executing this line:
C:\Users\fgbjbri\AppData\Local\NetBeans\Cache\10.0\executor-snippets\debug.xml:129:
The following error occurred while executing this line:
C:\Users\fgbjbri\AppData\Local\NetBeans\Cache\10.0\executor-snippets\debug.xml:77:
Java returned: 1{noformat}
The project compiles correctly and can be run from the command line.
If you delete the _lib_ folder and remove the _libraries_ section from
_project.xml_, then clean up the classpath and modulepath (remove all libraries
and re-add them) the project is run/debuggable again.
I've also seen this with projects with a dedicated libraries folder that worked
correctly with JDK8 and Netbeans 8.2 but fail when moved to OpenJDK 11, OpenJFX
11 & NetBeans 10.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists