EDIT: YOU CAN GO DIRECTLY TO THE 2018-02-13 UPDATE AT THE END OF THE POST FOR UPDATED INFORMATION
I can provide full source code as this problem has appeared in my open source project JMarkPad.
Basically:
- Building always works, I get a working .jar without any problem.
- Creating a native dist (running
gradle link
) WITHOUT 3rd party software (in this case, JFoenix) works too. - Creating a native dist (running
gradle link
) WITH 3rd party software (in this case, JFoenix) throws the following:
:linkAll
:JMarkPad:app:clean
:JMarkPad:app:compileJava
:JMarkPad:app:processResources
:JMarkPad:app:classes
:JMarkPad:app:jar
:JMarkPad:app:link
Error: Module app not found
:JMarkPad:app:link FAILED
:linkAll FAILED
Any experience with this? Please feel free to browse the whole project and ask any question about it, I really need help with this, and I'll gladly help anyone trying to help me.
Thank you for your patience.
Edit:
The jlink command can be found in the app/gradle.build file:
commandLine "${java_home}/bin/jlink", '--module-path', "libs${File.pathSeparatorChar}${java_home}/jmods",
'--add-modules', 'app', '--launcher', 'app=app/ui.UI', '--output', 'dist', '--strip-debug',
'--compress', '2', '--no-header-files', '--no-man-pages'
Edit 2: Full error:
9:28:38: Executing task 'link'...
:app:clean
:app:compileJava
:app:processResources
:app:classes
:app:jar
:app:link
Error: Module app not found
:app:link FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:link'.
> Process 'command 'C:\Program Files\Java\jdk-9.0.4/bin/jlink'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
5 actionable tasks: 5 executed
Process 'command 'C:\Program Files\Java\jdk-9.0.4/bin/jlink'' finished with non-zero exit value 1
9:28:39: Task execution finished 'link'.
2018-02-13 UPDATE:
https://github.com/mayuso/JMarkPad/tree/java-9-integration
It currently uses a single library, called JFoenix, as can be seen in the dependencies declaration in the build.gradle file here:
https://github.com/mayuso/JMarkPad/blob/java-9-integration/build.gradle
The library in question is present here:
https://github.com/mayuso/JMarkPad/tree/java-9-integration/libs
So now, when I try to run the software using gradle run
, compile it using gradle build
or make a distribution using jlink it always says error: module not found: com.jfoenix
.
I've asked the JFoenix mantainers, a couple Java bloggers that had experience with Java 9 and JLink and no one yet has been able to solve this issue.
Any idea of what am I doing wrong?
Many thanks for your patience.