javaFX helloworld jar cannot be ran on different platform - javafx

I am new to this JavaFX stuff and not sure if anyone knows what I did wrong. Here is the scenario:
On win 7, used netbeans 8 with jdk1.8.0_05 created a helloworld.jar
On win 7, java -jar helloworld.jar works fine
move the helloworld.jar to Redhat 5.8 and used the same version jdk1.8.0_05, java -jar helloworld.jar . and I see the following error
Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline found

Red Hat Enterprise Linux 5.8 is not a supported configuration for JavaFX in Java 8.
Red Hat Enterprise Linux 6.x (and some other Linux variants) is supported.
MidoriKid provides a procedure to allow JavaFX to be used on a Red Hat EL 5.x system in his answer to: running JavaFx jars on redhat 5.8. Note that although the procedure can be followed, it is recommended that you uses more recent RHEL system to run JavaFX in a supported configuration.

Related

How to enable JavaFX in NetbeansIDE 11.3

I can't get JavaFX working with NetBeans 11.3.
The NetBeans documentation says:
If you install JavaFX 2.1 to Windows manually, consider installing the JavaFX 2.1 libraries and runtime to the default location (C:/Program Files/Oracle/). NetBeans IDE checks the default locations for the JavaFX. If JavaFX 2 is in the default locations the IDE can automatically create a JavaFX-enabled Java platform.
I've put the Gluon SDK there, though the number is 11.0.2. NetBeans does not automatically create a JavaFX enabled platform.
This StackOverflow answer suggests cleaning the cache. That didn't help.
If I try to create a new JavaFX project from the IDE, I get the message:
Failed to automatically set-up a JavaFX Platform. Please go to Platform Manager, create a non-default Java SE platform, then go to the JavaFX tab, enable JavaFX and fill in the paths to valid JavaFX SDK and JavaFX Runtime. Note: JavaFX SDK can be downloaded from JavaFX website.
But there is no "JavaFX" tab on the platform manager. The NetBeans release notes way back in version 8.0.2 say:
Unlike previous versions of NetBeans IDE, NetBeans IDE 8.0.2 does not require that you set up an "FX-enabled" Java platform in order to utilize JavaFX support in the IDE. You can develop JavaFX projects in the IDE if you install any standard Java platform that is JDK 7 Update 6 or newer (JDK 7 Update 10 or newer is strongly recommended).
But presumably that is from when JavaFX was bundled in the JDK.
So how do I get NetBeans to recognise the Gluon JavaFX?
Manual workaround:
/nbproject/project.properties file
run.jvmargs=--module-path "D:\\Libraries\\Java9\\openjfx-13.0.2_windows-x64_bin-sdk\\javafx-sdk-13.0.2\\lib" \
--add-modules=javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web \
--add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED \
// you may need to add more --ad-exports arguments based on the errors that will crop up during the run phase. this stuff basically removes package access limiters at runtime so be careful.
then there's the compiler arguments
javac.modulepath=\
D:\\Libraries\\Java9\\openjfx-13.0.2_windows-x64_bin-sdk\\javafx-sdk-13.0.2\\lib
and i'm pretty sure you need this too
javac.classpath=\
${libs.JAVAFX13.classpath}:\

8u66 Windows 64-bit packager - install succeeds but application fails to start

My JavaFX Application is installed correctly in Windows 8 (64 bit) but refuses to run !
I use the JavaFX native packager to produce native install bundles for Windows (from an Eclipse / Ant script).
I create my Windows bundle from a 64-bit Windows 7 build machine - JDK used
: 8u66 b02 early access - 64-bit Windows.
Unfortunately there is no logs generated by Windows ! So it's difficult to know the cause of the crash.
For information this is the list of DLL installed :
MSVCP120.dll
MSVCR100.dll
MSVCR120.dll
My problem is similar to this issue (Java Bug system) : https://bugs.openjdk.java.net/browse/JDK-8131321
But this bug normally was fixed !
Any ideas ?

Cant find JavaFX in JDK8 for Arm

I downloaded and installed JDK8u33 for ARM on my beaglebone black, and according to this documentation (http://docs.oracle.com/javase/8/embedded/jdk-arm-8u6/index.html) javafx is included and supported.
However, I can not find jfxrt.jar anywhere in the JRE or JDK, and using javac on a simple javafx program yields "javafx.application" is not a package.
What gives?
As #eckig says, since the 8u33 for ARM version, Oracle has removed JavaFX from the ARM distribution.
To run any JavaFX application you can downgrade your version to the last JDK8u6 that supported JavaFX, or you can provide a valid jfxrt.jar.
And you can do it following this tutorial, cross building OpenJFX for ARM, or just using some already built distribution like this one hosted on the JavaFXPorts project.
Once you have downloaded armv6hf-sdk.zip, unzip it and you need to add this command line option to attach this external source to the classpath, with the extension mechanism:
-Djava.ext.dirs=<path to armv6hf-sdk>/rt/lib/ext
For instance, you need this to run one of the JavaFX old samples from its actual path:
sudo /opt/jdk1.8.0_33/bin/java -Djava.ext.dirs=<path to armv6hf-sdk>/rt/lib/ext -jar BrickBreaker.jar
The latest version of the Java Development Kit for ARM processors (JDK 8u33 for ARM) no longer supports JavaFX Embedded, it has been all of the tech news, for example here: http://jaxenter.com/jdk-arm-without-javafx-end-javafx-embedded-114212.html

JavaFX NoClassDefFoundError

I have installed JDK 8 a bit ago, to use the WebView, but I got an error. The error was this:
Exception in thread "main" java.lang.NoClassDefFoundError:
javafx/embed/swing/JFXPanel
I don't know why the Swing isn't embed into JavaFX for JDK 8, but anyone know how to fix this?
[ java -version output ]
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
Question is solved, I just needed to check in the Run Configuration that the right JRE was used.
Another question. It said the "source isn't attached" (I think the jfxrt.jar is not there where its supposed to be.) Any suggestions?
My guess is that you think you are using Oracle Java 8, but you aren't really and are using Java 7 instead or you are using an OpenJDK Linux version which does not have JavaFX. Run java -version and edit your question to include the output.

Unable to run Javafx from computer by double clicking the jar file

I have created a JavaFx application using Netbeans. It is running fine, if I run the application from Netbeans.But, if I double click the jar file, I am getting error message as
JavaFx 2.1.0 is required to view this content but JavaFx. Get the JavaFx runtime from javafx.com/javafx and run the installer. Then restart the application
But I already have JavaFX runtime installed in my PC. But, if I run the jar file from command line as java -jar MyJavaFxApplication.jar, then it is running properly.
My question is somehow similar to the question "Unable to run JavaFx Jar with JRE7". But that question still unanswered.
My Java version is :
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)
Thanks in advance.
If you use NetBeans 8 or JDK 1.8 you have to run the file using Java 8.
If Java 8 is installed on your system and it should be a bundle with NetBeans just point it to your JAVA PATH from Computer Properties Variables.

Resources