There is an issue I'm facing with Scene Builder where it keeps overwriting the JavaFX version to 15.0.1 whereas I am using version 11.0.2, so I get this warning when running:
WARNING: Loading FXML document with JavaFX API of version 15.0.1 by JavaFX runtime of version 11.0.2
I just edit the version number in the .fxml file:
<Pane maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="293.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1">
But when I make any changes in Scene Builder, it puts it back to 15.0.1 and I get the warning.
How can I fix this?
Since SceneBuilder takes:
System.getProperty("javafx.version") as check for its namespace. Maybe try to set this to desired version.
Edit:
Open configuration file where your ScenBuilder is installed: e.g.:
C:\Program Files\SceneBuilder\app\SceneBuilder.cfg
Inside under [JavaOptions] add:
java-options=-Djavafx.version=null
You can set it to your current version, but if it is set to NULL it wont check versions or put warning even you open FXML file in SceneBuilder with other version of JavaFX.
Related
I have the following problem when trying to launch a .jar file of my program in cmd: no main manifest attribute, in path/filename.jar
I tried to add the Main-Class to the MANIFEST.MF file, but then it says Error: Could not find or load main class.
In NetBeans I have set the Main Class at Properties->Run->Main Class to the one, which holds the function main(String[] args) in my case "com.nxp.vda_with_gui_1.version.App". I have also added VM Options for the JavaFX modules like the following:
--module-path C:\NetbeansJavaFX --add-modules javafx.controls,javafx.base,javafx.fxml,javafx.graphics,javafx.media
In NetBeans I can build and launch up my program without any errors, but when I try to "Run File" (Shift + F6) a different error will be put out:
Error: JavaFX runtime components are missing, and are required to run this application Command execution failed.
Any tips how to solve it?
Below you can find a picture of my file/package structure and some other information, maybe it helps finding a solution quicker:
file/package structure
JDK version: 16
JavaFX version: 18.0.2
OS: Windows
I am getting the following error when I run the main file in the Javafx project:
C:\Users\monu\OneDrive\Documents\jdk-11.0.10\bin\java.exe --module-path C:\D-drive\libraries\javafx-sdk-17.0.0.1\lib --add-modules javafx.fxml,javafx.controls,javafx.graphics --add-modules javafx.base,javafx.graphics --add-reads javafx.base=ALL-UNNAMED --add-reads javafx.graphics=ALL-UNNAMED "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.2.3\lib\idea_rt.jar=59212:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.2.3\bin" -Dfile.encoding=UTF-8 -classpath C:\D-drive\codage-aider\student\agbi\sample-github\C195\out\production\C195;C:\D-drive\libraries\mysql-connector-java-8.0.26.jar;C:\D-drive\libraries\javafx-sdk-17.0.0.1\lib\javafx-swt.jar;C:\D-drive\libraries\javafx-sdk-17.0.0.1\lib\javafx.web.jar;C:\D-drive\libraries\javafx-sdk-17.0.0.1\lib\javafx.base.jar;C:\D-drive\libraries\javafx-sdk-17.0.0.1\lib\javafx.fxml.jar;C:\D-drive\libraries\javafx-sdk-17.0.0.1\lib\javafx.media.jar;C:\D-drive\libraries\javafx-sdk-17.0.0.1\lib\javafx.swing.jar;C:\D-drive\libraries\javafx-sdk-17.0.0.1\lib\javafx.controls.jar;C:\D-drive\libraries\javafx-sdk-17.0.0.1\lib\javafx.graphics.jar main.java.C195
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:283)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:254)
at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:264)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
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:95)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
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:276)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
... 5 more
Process finished with exit code 1
In the run configurations in Intellij Idea the following is specified for the value of VM arguments : `--module-path "C:\D-drive\libraries\javafx-sdk-17.0.0.1\lib" --add-modules javafx.fxml,javafx.controls,javafx.graphics`
I have included the necessary JavaFX lib folder and MySQL connector jar that I am using in my project, But strangely I still get this weird error.
I downloaded the SDK for windows from here https://gluonhq.com/products/javafx/
that's a little weird. I am not sure if I am missing anything. As I have followed all the steps from the JavaFX website. I am using a non-maven project here. Any ideas or hints on how to proceed to debug this or fix it? Thanks
Minimal reproducible example :
package sample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
#Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root, 300, 275));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
sample.fxml :
<?import javafx.geometry.Insets?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<GridPane fx:controller="sample.Controller"
xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10">
</GridPane>
The VM arguments in the Intellij is - --module-path "C:\D-drive\libraries\javafx-sdk-17.0.0.1\lib" --add-modules javafx.controls
This is a simple normal JavaFX program. There is some setup issue that is causing the problem because there cannot be a simpler program than this. It looks like no JavaFX project is working.
I am experimenting with non-maven projects only.
i have never worked with intellij, i work with eclipse, i had the same problem not while running from the ide but when i exported it as a jar.
The thing is, the javafx sdk has a bin folder that contains several dll files, important for running the javafx app. The ide should use them once you add the libs to the build path, at least eclipse does that, make sure you have maintained the original folders in the sdk
To avoid this kind of problems in the future, and avoid to manually add all the dlls when i export the jar, i created a new java runtime image, using jlink, that has all the javafx sdk built in it.
This is the best option at least for me, if you want to go this way, you should download the javafx jmods and add them to the jmods folder in the jdk installation, after that you can create a new runtime image with jlink
I'll edit this post later and add the jlink command line
I upgraded to Xamarin.Forms 3.6 and the following error occurs.
System.MissingMethodException: 'Method 'CanvasImageSource.get_SizeInPixels()' from assembly 'Microsoft.Graphics.Canvas' was not included in compilation, but was referenced in ImageRenderer.GetDesiredSize(double, double). There may have been a missing assembly, or a dependency on a more recent Windows SDK release.'
The error occurs on this line:
Absoluate.Layout.SetLayoutBounds(navigationlayout, new Rectangle(0, 0, 1, 46);
In Xaml, navigation layout is
<StackLayout x:Name="navigationlayout" Orientation="Horizontal" AbsoluteLayout.LayoutFlags="WidthProportional">
...
</StackLayout>
I also installed the latest pre-release Xamarin.Forms 4.0.0-pre5 gives the same error.
Reverting back to Xamarin.Forms 3.5.0.169047, the app runs normally.
I found the answer in Github.
(1) In UWP project, install Win2D Nuget package.
(2) In UWP project, set the minimum target to Windows 10, version 1803 (10.0; Build 17134)
Update to Xamarin.Forms 3.6. Viola, the UWP app runs smoothly.
I am trying to setup a Flex/Java multi module project in Eclipse. Using Maven to run the build and generate the war file. The details of the versions I am using are as follows:
Flexmojos : 3.5.0
Flex framework/compiler : 4.5.1.21328
Target player : 10.2.0
And the playerglobal dependency in my pom file uses classifier as 10.2 with version 4.5.1.21328
Now when I run the build using 'mvn install', I get the following error:
[ERROR] Failed to execute goal
org.sonatype.flexmojos:flexmojos-maven-plugin:3.5.0:compile-swf
(default-compile-swf) on project client: TargetPlayer and
playerglobal dependency version doesn't match! Target player: 10.2.0,
player global: 10.2 -> [Help 1]
Any ideas why this might be happening?
I tried just playing around changing those version numbers, but still couldn't make it work for Flex 4.5.1. Please let me know how to go about this (and if you need more information). Thanks.
Regards
Basith
Have you tried simply referencing "10.2" instead of "10.2.0"? I think there was only one Flash player deployed with a 3-segment version number.
Implemeting RSL in Flex 3.2
The build comils perfectly but opening it shows Error #2124: Loaded file is an unknown type. URL:
Whereas I have confirmed the requisite files are there in the folder. i.e. SWZ/SWF.
I also noticed we assetCache does not contains framework swz.
Any pointers ?
I found the issue, I modified Flex_config.xml and kept the default RSL tag uncommented.
<runtime-shared-libraries>
<url rsl-url="framework_3.2.0.3958.swf"/>
<url rsl-url="framework_3.2.0.3958.swz"/>
This should be commented ...