openjfx / samples

JavaFX samples to run with different options and build tools
BSD 3-Clause "New" or "Revised" License
589 stars 1.52k forks source link

Error: jlink requires a module descriptor #47

Closed bmarwell closed 4 years ago

bmarwell commented 4 years ago

I tried to follow the example: https://github.com/openjfx/samples/tree/master/CommandLine/Modular/Maven

it says:

To create and run a custom JRE:

cd CommandLine/Modular/Maven/hellofx
mvn clean javafx:jlink

This is the result:

$ mvn clean javafx:jlink
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------< org.openjfx:hellofx >-------------------------
[INFO] Building demo 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hellofx ---
[INFO] Deleting $USER/git/openjfx-samples/HelloFX/Maven/hellofx/target
[INFO] 
[INFO] --- javafx-maven-plugin:0.0.3:jlink (default-cli) @ hellofx ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory $USER/git/openjfx-samples/HelloFX/Maven/hellofx/src/main/resources
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to $USER/git/openjfx-samples/HelloFX/Maven/hellofx/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.038 s
[INFO] Finished at: 2020-04-17T13:55:50+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.3:jlink (default-cli) on project hellofx: Error: jlink requires a module descriptor -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Using

Maven

$ mvn -version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.6, vendor: Eclipse OpenJ9, runtime: $USER/.jabba/jdk/adopt-openj9@1.11.0-6
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-21-generic", arch: "amd64", family: "unix"

Java

$ java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.18.1, JRE 11 Linux amd64-64-Bit Compressed References 20200122_441 (JIT enabled, AOT enabled)
OpenJ9   - 51a5857d2
OMR      - 7a1b0239a
JCL      - da35e0c380 based on jdk-11.0.6+10)
bmarwell commented 4 years ago

Never mind, I did not change into the CommandLine directory.