JavaFX runtime components are missing whenrunning an exported jar - java

I created a project in eclipse and want to run my exported .jar file on an other machine. When I try to do so using "java -jar myfile.jar", I get the following message:
Error: JavaFX runtime components are missing, and are required to run this application
If I run it in eclipse (using jdk13), everything works.
On the machine where I want to run the jar file I installed openjdk and openjfx. Actually I'm not sure wether the problem has to be solved in eclipse while exporting the jar file or on the other machine while running it? And how? May anyone give me a hint?

Related

Jar file executes in InteliJ IDE but not in windows

Running in intelij
When i try to run the .jar
Edit environment variable path
I've written my first small program in java, and want to make it into an executeable file.
I used InteliJ to generate a .Jar file out of the Main class. When i Run the Jar in Intelij it seems to work fine. However once i try to open it from my windows i get
error a jni error has occurred please check your installation and try again
Some googling told me that my JDK might not be properly set in my system properties, so i added the path to my JDK, however the error remains. Anyone have any idea what's up with this? I believe that I added my JDK through inteliJ. Why is it so difficult to simply run the program i made? Is there something wrong with my JDK? is my .jar corrupt?

Extra dll files packaged by JavaFX installer between jdk 8u144 and 8u172

I am building an installer for a JavaFX 1.8 Windows application.
This application contains a JNI.
When I run the Ant script with the jdk 1.8.0_172, files named api-ms-win-core-*.dll and ucrtbase.dll are copied to the runtime\bin install directory. Those files are not present when I run the exact same script with jdk 1.8.0_144.
I have tested my program without those files and it works fine. What could be a path to investigate to understand how to get rid of those files?
Also, msvcp120.dll is updated to msvcp140.dll and vcruntime140.dll file appears (and is needed).
Thanks!

Java3d - Jar file contains error java.lang.NoClassDefFoundError javax/media/j3d/Canvas3D

I am currently having a problem running a jar file created by eclipse.
Within eclipse I can run my project using the run function and the project runs exactly as expected.
The same applies to compiling and running the code from command line using javac Menu.java to compile and java Menu to run.
Both of these run correctly and do not return the error I receive when running the jar file.
The jar file was created in eclipse by exporting the project. But when i run the jar file the application refuses to response when opening any JFrames containing Java3d. Upon debugging the jar file i receive the error
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/media/j3d/Canvas3D
This normally would lead me to believe that my CLASSPATH is incorrect but since the project runs from command line this doesn't seem likely.
Any help or pointers would be very helpful.
Thanks.
Found a solution which works.
Instead of simply creating a jar file, you can created a runnable Jar file.
When asked under library handling in the export process, selecting 'package required libraries into generated JAR' solves this issue and allows it to run on all computers, even ones without Java3D installed.

.jar file will not open

I have created an executable jar file and have tried both the extract and package option for generated .jar. It creates it but when clicking on it nothing happens. I tried naming it the same as the class file or the project file too. This didn't happen before I don't know why it stoped working. It won't run even a simple hello world file. However a .jar file I made a while ago will run. I compiled with Eclipse, and running it with java -jar in cmd does work. I am running Windows 07. Any help would be greatly appreciated
Edit: tried uninstalling and reinstalling Java and Java JDK
you should check the application used to open the jar file. it should be java or javaw and should be called with -jar parameter. What Operating system are you using?

Error: JavaFX runtime components are missing, and are required to run this application

I tried to build the application using javafx ant build, generated jar file.
But when I run the jar file, issue:
Error: JavaFX runtime components are missing, and are required to run this application.
The javafx-class-path: libs/h2.jar libs/jfxrt.jar libs/log4j.jar
Running the JAR file using:
java -jar app.jar
What could it be?
I was able to reproduce your issue on windows machine (with java8 64bit version).
One simple work around could be: try reinstalling java again.
Another could be: copying jre/lib/jfxrt.jar to jre/lib/ext/jfxrt.jar

Categories

Resources