JavaFX NoClassDefFoundError - javafx

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.

Related

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 ?

Java Application not opening on Ubuntu but opening on windows

Hi I have java desktop application developed by myself which uses external jar files. When i open it on windows it opens successfully but on Ubuntu 14.04 it fails with exception.
Windows:
java -cp bin;lib\thinlet.jar;lib\xercesImpl.jar;lib\xml-apis.jar;lib\commons-cli-1.0.jar;lib\jsyntaxpane-0.9.5-b29.jar;lib com.macpropeditor.propedit.ApplicationRunner
Ubuntu:
java -cp bin:lib\thinlet.jar:lib\xercesImpl.jar:lib\xml-apis.jar:lib\commons-cli-1.0.jar:lib\jsyntaxpane-0.9.5-b29.jar:lib com.macpropeditor.propedit.ApplicationRunner
On ubuntu I am getting below error:
abc#abc-virtual-machine:~/MACPropEditor$ java -cp bin:lib\thinlet.jar:lib\xml-apis.jar:lib\xercesImpl.0.jar:lib\jsyntaxpane-0.9.5-b29.jar:lib com.macpropeditor.propedit.ApplicationRunner
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2570)
at java.lang.Class.getMethod0(Class.java:2813)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
Is there anything i need to set on Ubuntu? Please suggest.
All jars present in 'lib' directory.
Java version windows:
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Client VM (build 20.2-b06, mixed mode, sharing)
Java version Ubuntu:
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.2) (7u65-2.5.2-3~14.04)
OpenJDK Server VM (build 24.65-b04, mixed mode)
Programm is compliled on windows machine and deployed on ubuntu as well.
I'm betting it's due to different Java versions. Java on Ubuntu is not recognizing the class(es) because they are compiled using a later version of Java (eg Java 8, but running with Java 7).
Check your java version in both cases using java -version.
Problem is resolved:
I was using '\' instead of '/' on ubuntu.
So the below cmd is working:
java -cp bin:lib/commons-cli-1.0.jar:lib/thinlet.jar:lib/xercesImpl.jar:lib/xml-apis.jar:lib/jsyntaxpane-0.9.5-b29.jar:lib com.macpropeditor.propedit.ApplicationRunner

javaFX helloworld jar cannot be ran on different platform

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.

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.

Oracle: Error while registering Oracle JDBC Diagnosability MBean

I am trying to install OracleClient 11g and initially i had a issue regarding JDK compatibility.
Error:
so i ended up uninstalling JDK 7 (64bit) and reinstalled JDK 6 (32bit) and edited sqldeveloper.conf for SetJavaHome.
SetJavaHome C:\Program Files (x86)\Java\jdk1.6.0_31
Now, once i click sqldeveloper.exe it loads up and throws an error as mentioned below
Error (i):
Error (ii):
I tried similar issue thread in stackoverflow but didn't help much. So any help is much appreciated.
Couldn't solve the problem but found out an alternative way.
Install JDK1.6 ( 32bit)
Install Oracle Client (32bit)
Note: even if u have OS 64bit, try installing 32bit JDK & Oracle client and u should not face this error.

Resources