I am attempting to run (using Maven's javafx:compile then javafx:run) the default JavaFX Application when you create a new IntelliJ project using Maven and the JavaFX archetype.
Here are the first few lines of the error, rest doesn't have any useful information:
[INFO]
[INFO] --- javafx-maven-plugin:0.0.3:run (default-cli) @ ISAMG ---
Unrecognized option: --module-path
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
...
Some Java configuration details:
- The Project JDK for this project was downloaded through IntelliJ (OpenJDK).
- Project language level is 14.
- Module language level is 14.
- Target bytecode is set to 14.
- Maven's Runner JRE is set to the same project JDK (NOT through JAVA_HOME environmental variable).
- JavaC version given in IntelliJ's terminal is
javac 14.0.1
- Java version given in IntelliJ's terminal is
java version "1.8.0_261"
- Maven itself is not installed on my computer separately from IntelliJ.
- Project is a module project (with a module-info.java)
- There are no plugins.
These are the steps I've tried/checked:
- Using javafx-maven-plugin versions 0.0.1 through 0.0.4
- Used a separately-downloaded copy of the JDK (from Oracle's website) and had everything point to that.
- Set language levels and target bytecode to 11.
- Tried JavaFX versions 12.0.2 and 14
- Tried running Maven's
compile:compile
thenresources:resources
thenjavafx:run
. Also triedclean:clean
beforehand. - Tried using JAVA_HOME (for both user and system) and pointing to the separately downloaded JDK.
- Explicitly overrode IntelliJ's Maven Runner's pointed directory by adding an
<executable>path/and/stuff</executable>
pointing to JDK - Git was updated to current version.
- Deleted everything in the .idea folder.
- Disabled my antivirus software
- Deleted and remade the
.iml
file in case of conflict with thepom.xml
file. - Overrode the target bytecode version by altering Maven's
org.apache.maven.plugins
configuration/release version to 14. - Reinstalled Java.
- Restarted system after each above step.
Things of note:
- Running the program using an Application configuration does bring up the scene correctly.
- Running javafx:compile does not produce errors nor warnings. Nor does javafx:jlink (though this fails with a not-found error if using javafx-maven-plugin version 0.0.4).
- During project creation there was no
settings.xml
for Maven so I created one based on defaults found online and placed it in the folder the error pointed to. There was a\repository
folder, however. - I had the stated problem for a few hours, modified some things, then it changed to a
Java.io.IOException: CreateProcess error=5, Access is denied
error. Further changes brought be back to the original error. Steps I did were included above. Solutions provided may result in the above error coming back again.