javafx-maven-plugin | Maven plugin to run JavaFX 11+ applications
kandi X-RAY | javafx-maven-plugin Summary
kandi X-RAY | javafx-maven-plugin Summary
Maven plugin to run JavaFX 11+ applications
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Executes the JLinkExecutor
- Creates the command line arguments
- Applies the launcher script to the launcher script
- Checks to see if the JLink is newer version
- Creates a zip archive from an image
- Execute the mojo
- Creates the command arguments
- Splits a comma - separated string into a list of arguments
- Creates the add modules string
- Split a complex argument string into a list of Strings
javafx-maven-plugin Key Features
javafx-maven-plugin Examples and Code Snippets
Community Discussions
Trending Discussions on javafx-maven-plugin
QUESTION
The thing is simple. I want to create a javafx project with WevView support.
Here are the steps i followed:
- Open intellij, create new project, select javafx on the left side, and also select maven on the right side, finish.
- I added a javafx web dependency in pom.xml
ANSWER
Answered 2022-Apr-08 at 15:26Add the line requires javafx.web;
to your module-info.java
.
QUESTION
I added a library to my JavaFX projects following these steps:
- File --> Project Structure --> Project Settings --> Libraries --> + --> Maven
- Insert the Maven coordinates and checked the "Download to projectPath/libs"
- In pom.xml added the correct dependecy declaration
- In module-info.java added the 'requires module'
Importing the library to my class seems to work, but after calling a method from the library, it results in a
...ANSWER
Answered 2022-Mar-21 at 17:21From the comments, you seem to be using some less common libraries. Sometimes, those kinds of libraries are not updated to be compatible with the Java Platform Module System. I think it is probably safe to assume that unless you know otherwise.
Defining a non-modular project
The easiest way to deal with such dependencies is to make your project non-modular: delete the module-info.java
.
But JavaFX itself is only supported as modules. So, even though your project and its dependencies are non-modular, you should still place the JavaFX libraries on the module path.
Using a JDK which includes JavaFX
To accomplish such a setup (non-modular application using JavaFX modules), the easiest way is to rely on a JDK or JRE that includes JavaFX modules, for example, the Zulu JDK FX distribution or the Liberica Full JDK distribution. It is important to use the correct distribution as the base JDK distributions for Zulu and Liberica do not include JavaFX.
Using a base JDK which does not include JavaFX
With a bit more work, you can use OpenJDK. You can do this by sourcing the JavaFX modules from either the maven repository with a build tool, or a manual download of the modules and SDK from Gluon. In all your build and execution steps, you need to ensure that all of those modules are on the module path and declared to the module system via either VM arguments or a module-info.java
.
Building with Maven
For a Maven build, you need to add each module to the module path individually, as they are all in separate directories in the local .m2
repository (modern Maven systems and some IDEs, such as Idea, will do that automatically, other IDEs such as VSCode may not).
Building with the SDK
Alternately, don't add dependencies on the JavaFX modules via Maven. Instead, download the JavaFX SDK and add the JavaFX modules there via VM arguments --module-path
and --add-modules
. This process for adding JavaFX modules to OpenJDK is documented in the getting started documentation at openjfx.io.
A note on openjfx.io Maven archetypes
Note that the openjfx.io getting started documentation around this mentions maven archetypes. My advice is not to use those as they are really difficult to work with if you try to use them from IDEs. Instead, use the Idea new JavaFX project wizard, either keeping the module-info.java it generates for a modular project or removing it and manually specifying JavaFX module VM arguments for a non-modular project.
Issues with your project build
In terms of your actual project, I encountered the same error that duffymo pointed out in the comments:
I can't resolve all the dependencies for web3jm-evm from Maven Central. It's pulling in a bunch of JARs from org.hyperledger.besu that aren't in Maven Central.
So I was unable to build or test it.
QUESTION
I have a issue, not being able to import MediaPlayer in my JavaFX project. I am using IntelliJ with a Maven build, JDK 17 .. I updated the Maven dependencies and I have the JavaFX plugin installed, and it is still not working.. Thanks in advance for any answer/suggestion
...ANSWER
Answered 2022-Mar-14 at 10:43If you define a module-info.java
file and you want to use the javafx.media
module, you need to require that module in your module-info (as suggested by kleopatra in comments).
QUESTION
I am having a problem creating a .jar file for my JAVAFX Program.
important info:
JAVAFX Version: 17
JAVA Version: 17
IDE: Intellij
Project Uses Maven
..................................................................................................................................................................................................................................................
file structure:
module File:
...ANSWER
Answered 2022-Feb-15 at 20:21Try to create a new Class with a main method that calls the main Method of your Application class and use it as entry point.
QUESTION
My pom includes the itext7-core artifact.
...ANSWER
Answered 2022-Jan-28 at 03:49The solution with JPackageScriptFX is the best. Thanks Jewelsea. Jmods from javafx copied to C:/jdk/jmods. Then in bat file
QUESTION
When trying to use jlink on Fedora from this plugin https://github.com/openjfx/javafx-maven-plugin
...ANSWER
Answered 2022-Jan-19 at 00:24I am missing the jmods directory in my jdk. On Fedora jmods are a separate install
https://fedora.pkgs.org/35/fedora-x86_64/java-11-openjdk-jmods-11.0.12.0.7-4.fc35.x86_64.rpm.html
Run sudo dnf install java-11-openjdk-jmods
QUESTION
I wrote JavaFx project in Eclipse IDE, it worked correctly.
Once I converted it into Maven project, my FMXL files stopped opening. However, if I create new FXML files and put them in the same folders, everything works.
Is there any way to run my Maven project without recreating all my FXML files?
I've already tried changing paths to my FXML files in code, moving FXMLs to src/main/resources package or simply copying the code from old FXMLs to the new ones, but nothing worked.
All FXMLs I created in SceneBuilder and haven't changed the version of this program throughout the process.
I'm loading my FXMLs using the following method:
...ANSWER
Answered 2022-Jan-13 at 20:54This is unrelated to Maven, it is an access error caused by incorrect configuration of the Java module system for your application.
The error message tells you what is wrong:
QUESTION
Hello i am using jnativehook library with javafx running with mvn javafx:run
works fine but with mvn javafx:jlink
fails to start with a launcher, here is javafx plugin xml,
ANSWER
Answered 2022-Jan-12 at 09:47Caution
JavaFX has keyboard handling in-built.
Absolutely do not do this unless you need some capability not built into JavaFX.
That said . . . if you really need to do this . . .
I got this to work via the following steps:
Created a new JavaFX project via the Idea New JavaFX project wizard.
Added a dependency to JNativeHook 2.2-SNAPSHOT.
Snapshot was required because 2.2.1 release module-info would not work for me.
QUESTION
I have been trying to create a jar with maven and the maven-shade-plugin for my JavaFX project following this tutorial. https://www.youtube.com/watch?v=EyYb0GmtEX4.
I can create the jar file but when I run it, it gives me the error:
Error: Could not find or load main class com.example.pleasework.com.example.pleasework.Main_1
Caused by: java.lang.ClassNotFoundException: com.example.pleasework.com.example.pleasework.Main_1
I have already tried adding
java --module-path /path/to/java-fx-libs/ --add-modules javafx.controls,javafx.fxml MyMainClass
to vm options but it just changes the error to Error: Could not find or load main class Java
. Also, I have a second Main file that runs my first Main file which extends Application.
I am using IntelliJ and created my project through IntelliJ's built-in JavaFX project with Maven. I can run my project normally and it works fine, but when I try to run the shaded jar I generated through Maven's shade plugin I get these errors.
Here is my 2nd Main file
...ANSWER
Answered 2022-Jan-02 at 17:57The error message indicates that you have to specify the main class without module name. Just use the fully qualified class name there. A fully qualified never contains a slash as it is not a path name. So in your case the fully qualified class name is including the XML tags around (the main class is used two times in your pom.xml and have to be corrected in both cases):
QUESTION
While updating JavaFX projects to version 17.0.1, a new warning message is being issued by any version of the javafx-maven-plugin
with a version number of 0.0.5 or greater.
The warning message is:
...ANSWER
Answered 2021-Dec-27 at 19:27I recently encountered the same problem here:
When executing the command
mvn javafx:run
, thejavafx-maven-plugin
produces the following:[WARNING] Module name not found in . Module name will be assumed from module-info.java
. ThemainClass
configuration attribute is the "fully qualified name, with or without module name." While the warning can be safely ignored, adding the module name eliminates the warning:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install javafx-maven-plugin
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page