Closed EasyG0ing1 closed 2 years ago
Hi @EasyG0ing1! I'm sorry for my late reply. I've been out for working.
Are you running the packaging process on Linux or Mac OS?
This path:
/home/michael/Java/jdk-18.0.1.1/jmods
comes from: jdkPath
+ /jmods
@fvarrui - I'm running the packaging process on Ubuntu Linux ... latest version.
When I do a mvn clean package -X
I get this in the output ...
[INFO] Runnable jar created in /home/michael/IdeaProjects/GistFX/target/GistFX-3.4.60-runnable.jar!
[INFO]
[INFO] Bundling JRE ... with /home/michael/Java/jdk-18.0.1.1
[INFO] Creating customized JRE ...
[INFO] Getting required modules ...
[INFO] Executing command: /bin/sh -c cd '/home/michael/IdeaProjects/GistFX/.' && '/home/michael/Java/jdk-18.0.1.1/bin/jdeps' -q --multi-release 18 --ignore-missing-deps --print-module-deps /home/michael/IdeaProjects/GistFX/target/GistFX/libs/*.jar /home/michael/IdeaProjects/GistFX/target/GistFX-3.4.60-runnable.jar
[INFO] java.base,java.management,java.naming,java.net.http,java.prefs,java.security.sasl,java.sql,jdk.jfr,jdk.jsobject,jdk.unsupported,jdk.unsupported.desktop,jdk.xml.dom
[INFO] Required modules found: [java.base, java.management, java.naming, java.net.http, java.prefs, java.security.sasl, java.sql, jdk.jfr, jdk.jsobject, jdk.unsupported, jdk.unsupported.desktop, jdk.xml.dom]
[INFO]
[INFO] Creating JRE with next modules included: java.base,java.management,java.naming,java.net.http,java.prefs,java.security.sasl,java.sql,jdk.jfr,jdk.jsobject,jdk.unsupported,jdk.unsupported.desktop,jdk.xml.dom
[INFO] Using /home/michael/Java/jdk-18.0.1.1/jmods modules directory
[INFO] Executing command: /bin/sh -c cd '/home/michael/IdeaProjects/GistFX/.' && '/home/michael/Java/jdk-18.0.1.1/bin/jlink' --module-path /home/michael/Java/jdk-18.0.1.1/jmods --add-modules java.base,java.management,java.naming,java.net.http,java.prefs,java.security.sasl,java.sql,jdk.jfr,jdk.jsobject,jdk.unsupported,jdk.unsupported.desktop,jdk.xml.dom --output /home/michael/IdeaProjects/GistFX/target/GistFX/jre --no-header-files --no-man-pages --strip-debug --compress=2
[INFO] Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.449 s
[INFO] Finished at: 2022-05-27T16:50:03-07:00
[INFO] ------------------------------------------------------------------------
Seems to be an issue with objcopy
not being found - whatever that is ... I did a find for any file with that name and nothing came back so I don't know what it's looking for, nor why it's looking for that file.
@fvarrui - OK, nevermind, I figured it out ... apparently objcopy
is part of something called binutils
... so I installed that and everything completed successfully ... I have install artifacts ... now to go test them :-)
Hi @EasyG0ing1! Great ... sorry for my lack of help. Despite of this problem has already been reported before, I didn't realize that this could be the same case. I think I'm going to add a comment in the docs.
And there's an error when printing the executed commands (and possibly this causes confusion):
/home/michael/Java/jdk-18.0.1.1/bin/jlink
--module-path /home/michael/Java/jdk-18.0.1.1/jmods
[Ljava.lang.String;@634aa81e --add-modules ALL-MODULE-PATH
--output /home/michael/IdeaProjects/GistFX/target/GistFX/jre
--no-header-files
--no-man-pages
--strip-debug
--compress=2
In the third line you can see this: [Ljava.lang.String;@634aa81e
.... it's only a problem when printing arrays. It doesn't affect to the command execution, but I have to fix it.
@fvarrui - Yeah, I noticed that. I just deleted it before running the command independently, which was helpful in finding the source of the problem, ultimately.
During an attempt to build for Linux, I received this error (I added the line breaks to make it easer to see):
Here is the same output unedited
Where I believe the problem exists, is here:
I'm not sure where it's getting this path from but clearly my module path doesn't exist within the JDK folder tree...
Here is my POM config: