Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete set of modules for customized JRE #421

Open
2 of 5 tasks
dbelob opened this issue Jul 1, 2024 · 4 comments
Open
2 of 5 tasks

Incomplete set of modules for customized JRE #421

dbelob opened this issue Jul 1, 2024 · 4 comments
Labels
bug Something isn't working feedback Waiting for feedback fixed Issue fixed and release pending

Comments

@dbelob
Copy link

dbelob commented Jul 1, 2024

I'm submitting a…

  • bug report
  • feature request
  • other

Short description of the issue/suggestion:

In version 1.7.6 customized JRE includes an incomplete set of modules (bundleJre=true, customizedJre=true)

Steps to reproduce the issue/enhancement:

  1. Clone repository and checkout javapackager-1.7.6 branch:
    git clone -b javapackager-1.7.6 https://github.com/dbelob/multiplatform-distribution.git
  2. cd multiplatform-distribution
  3. mvn clean package -P native-deploy
  4. cd multiplatform-distribution-client\target
  5. Run multiplatform-distribution-1.1.0-SNAPSHOT.exe
  6. Select any language
  7. Accept license agreement
  8. Select destination location (any folder)
  9. Select start menu folder (any name)
  10. Check Create a desktop shortcut flag
  11. Push Install button
  12. Check Launch Multiplatform distribution flag
  13. Push Finish button
  14. The application will not start
  15. Click Multiplatform distribution link on desktop
  16. The application will not start

What is the expected behavior?

The master branch contains version 1.7.5 of the JavaPackager plugin which runs correctly:

  1. git checkout master
  2. mvn clean package -P native-deploy
  3. cd multiplatform-distribution-client\target
  4. Run multiplatform-distribution-1.1.0-SNAPSHOT.exe
  5. Select any language
  6. Accept license agreement
  7. Select destination location (any folder)
  8. Select start menu folder (any name)
  9. Check Create a desktop shortcut flag
  10. Push Install button
  11. Check Launch Multiplatform distribution flag
  12. Push Finish button
  13. The application starts successfully (see the window in the upper left corner of the screen)
  14. Close application window
  15. Click Multiplatform distribution link on desktop
  16. The application starts successfully (see the window in the upper left corner of the screen)

What is the current behavior?

  • The application will not start
  • JRE folder (C:\Program Files\AcmeSoft\Multiplatform Distribution\jre) does not contain all the necessary modules for the application

Do you have outputs, screenshots, demos or samples which demonstrate the problem or enhancement?

Output for 1.7.6 version (invalid module set):

Required modules found: [java.base, java.logging, java.xml]
Creating JRE with next modules included: java.base,java.logging,java.xml

Output for 1.7.5 version (valid module set):

Required modules found: [java.base, java.desktop, java.logging, java.naming]
Creating JRE with next modules included: java.base,java.desktop,java.logging,java.naming

What is the motivation / use case for changing the behavior?

To fix customized JRE creation.

Please tell us about your environment:

  • JavaPackager version: 1.7.6
  • OS version: Windows 10
  • JDK version: 21.0.3
  • Build tool:
    • Maven 3.9.0
    • Gradle
  • Inno Setup 6.2.2

Other information (e.g. related issues, suggestions how to fix, links for us to have context)

Related issue #399

P. S. @fvarrui Thank you very much for the excellent JavaPackager plugin!!!

@fvarrui
Copy link
Owner

fvarrui commented Jul 3, 2024

Hi @dbelob!
I think I found a solution that fixes issue 399 and yours... I haven't been able to do more exhaustive tests, but I hope that time and users will prove me right 😉

Full JP output building your project:

[INFO] --- javapackager:1.7.7-SNAPSHOT:package (default) @ multiplatform-distribution-client ---
[INFO] Using packager io.github.fvarrui.javapackager.packagers.WindowsPackager
[INFO] Creating app ...
[INFO]     Initializing packager ...
[INFO]         PackagerSettings [outputDirectory=C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target, licenseFile=C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\license.txt, iconFile=null, generateInstaller=false, forceInstaller=false, mainClass=acme.distribution.App, name=Multiplatform Distribution, displayName=Multiplatform Distribution, version=1.1.0-SNAPSHOT, description=Multiplatform Distribution, url=null, administratorRequired=false, organizationName=AcmeSoft, organizationUrl=http://www.acme.com, organizationEmail=null, bundleJre=true, customizedJre=true, jrePath=null, jdkPath=C:\Program Files\GraalVM\graalvm-community-openjdk-21.0.2+13.1, additionalResources=[C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\..\multiplatform-distribution-distrib\readme.txt], modules=[], additionalModules=[], platform=windows, envPath=null, vmArgs=[], runnableJar=null, copyDependencies=true, jreDirectoryName=jre, winConfig=WindowsConfig [icoFile=C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\assets\windows\multiplatform-distribution.ico, headerType=gui, companyName=AcmeSoft, copyright=AcmeSoft, fileDescription=Multiplatform Distribution, fileVersion=1.0.0.0, internalName=Multiplatform Distribution, language=null, originalFilename=Multiplatform Distribution.exe, productName=Multiplatform Distribution, productVersion=1.0.0.0, trademarks=AcmeSoft, txtFileVersion=1.1.0-SNAPSHOT, txtProductVersion=1.1.0-SNAPSHOT, shortcutName=Multiplatform Distribution, disableDirPage=false, disableProgramGroupPage=false, disableFinishedPage=false, disableRunAfterInstall=false, disableWelcomePage=false, createDesktopIconTask=true, generateSetup=true, generateMsi=true, generateMsm=false, msiUpgradeCode=d264f2e8-b0fe-470f-b5c4-098b8aa5b159, wrapJar=true, setupLanguages={english=compiler:Default.isl, french=compiler:Languages\French.isl, german=compiler:Languages\German.isl, italian=compiler:Languages\Italian.isl, portuguese=compiler:Languages\Portuguese.isl, russian=compiler:Languages\Russian.isl, spanish=compiler:Languages\Spanish.isl}, setupMode=installForAllUsers, signing=null, registry=Registry [entries=[]], removeOldLibs=false, exeCreationTool=launch4j, vmLocation=null], linuxConfig=null, macConfig=null, createTarball=false, tarballName=null, createZipball=false, zipballName=null, extra={innosetup.appCopyright=Copyright (c) 2024 AcmeSoft, innosetup.uninstallDisplayName=Multiplatform Distribution, innosetup.wizardImageFile=C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client/assets/windows/multiplatform-distribution-wizard-image.bmp, innosetup.wizardSmallImageFile=C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client/assets/windows/multiplatform-distribution-setup-icon.bmp}, useResourcesAsWorkingDir=true, assetsDir=C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\assets, classpath=null, jreMinVersion=null, manifest=null, additionalModulePaths=[], fileAssociations=[], packagingJdk=C:\Program Files\GraalVM\graalvm-community-openjdk-21.0.2+13.1, scripts=Scripts [bootstrap=null, preInstall=null, postInstall=null], arch=x64, templates=[Template [name=windows/iss.vtl, bom=true]]]
[INFO]     Packager initialized!
[INFO]
[INFO]     Creating app structure ...
[INFO]         App folder created: C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution
[INFO]         Assets folder created: C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\assets
[INFO]     App structure created!
[INFO]
[INFO]     Resolving resources ...
[INFO]         License file found: C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\license.txt
[INFO]         Icon file resolved: C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\assets\windows\multiplatform-distribution.ico
[WARNING]         Skipped adding the icon file as additional resource because the target platform is Windows
[INFO]         Effective additional resources [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\..\multiplatform-distribution-distrib\readme.txt, C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\license.txt]
[INFO]     Resources resolved!
[INFO]
[INFO]     Copying additional resources
[INFO]         Copying file [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\..\multiplatform-distribution-distrib\readme.txt] to folder [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution]
[INFO]         Copying file [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\license.txt] to folder [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution]
[INFO]     All additional resources copied!
[INFO]
[INFO]     Copying all dependencies ...
[INFO] Copying logback-classic-1.5.6.jar to C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs\logback-classic-1.5.6.jar
[INFO] Copying logback-core-1.5.6.jar to C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs\logback-core-1.5.6.jar
[INFO] Copying slf4j-api-2.0.13.jar to C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs\slf4j-api-2.0.13.jar
[INFO] Copying jcl-over-slf4j-2.0.13.jar to C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs\jcl-over-slf4j-2.0.13.jar
[INFO] Copying jul-to-slf4j-2.0.13.jar to C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs\jul-to-slf4j-2.0.13.jar
[INFO]     Dependencies copied to C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs!
[INFO]
[INFO]     Creating runnable JAR...
[INFO] Building jar: C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\multiplatform-distribution-1.1.0-SNAPSHOT-runnable.jar
[INFO]     Runnable jar created in C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\multiplatform-distribution-1.1.0-SNAPSHOT-runnable.jar!
[INFO]
[INFO]     Bundling JRE ... with C:\Program Files\GraalVM\graalvm-community-openjdk-21.0.2+13.1
[INFO]         Creating customized JRE ...
[INFO]         Getting required modules ...
[INFO]             Executing command: cmd.exe /s /c ""C:\Program Files\GraalVM\graalvm-community-openjdk-21.0.2+13.1\bin\jdeps" -q --multi-release 21 --ignore-missing-deps --print-module-deps --add-modules=ALL-MODULE-PATH "--module-path=C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\multiplatform-distribution-1.1.0-SNAPSHOT-runnable.jar;C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs" "C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs" C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\multiplatform-distribution-1.1.0-SNAPSHOT-runnable.jar"
[INFO]             java.base,java.desktop,java.logging,java.naming
[INFO]         Required modules found: [java.base, java.desktop, java.logging, java.naming]
[INFO]
[INFO]         Creating JRE with next modules included: java.base,java.desktop,java.logging,java.naming
[INFO]         Using C:\Program Files\GraalVM\graalvm-community-openjdk-21.0.2+13.1\jmods modules directory
[INFO]         Executing command: cmd.exe /s /c ""C:\Program Files\GraalVM\graalvm-community-openjdk-21.0.2+13.1\bin\jlink" "--module-path=C:\Program Files\GraalVM\graalvm-community-openjdk-21.0.2+13.1\jmods" --add-modules java.base,java.desktop,java.logging,java.naming --output "C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\jre" --no-header-files --no-man-pages --strip-debug --release-info add:IMAGE_TYPE="JRE":OS_ARCH="x86_64":OS_NAME="Windows""
[INFO]         Removing folder [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\jre\legal]
[INFO]     JRE bundled in C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\jre!
[INFO]
[INFO]     Creating windows EXE ... with launch4j
[INFO]         Exe manifest file generated in C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\assets\Multiplatform Distribution.exe.manifest!
[INFO]         Copying file [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\assets\Multiplatform Distribution.exe.manifest] to file [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\launch4j\app.exe.manifest]
[INFO]         Copying file [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\assets\windows\multiplatform-distribution.ico] to file [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\launch4j\app.ico]
[INFO]         Copying file [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\multiplatform-distribution-1.1.0-SNAPSHOT-runnable.jar] to file [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\launch4j\app.jar]
[WARNING]         Launch4J only can generate 32-bit executable
[INFO] Platform-specific work directory already exists: C:\Users\fvarrui\.m2\repository\net\sf\launch4j\launch4j\3.50\launch4j-3.50-workdir-win32
[INFO] launch4j: Compiling resources
[INFO] launch4j: Linking
[INFO] launch4j: Wrapping
WARNING: Sign the executable to minimize antivirus false positives or use launching instead of wrapping.
[INFO] launch4j: Successfully created C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\launch4j\app.exe
[INFO]         Copying file [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\launch4j\app.exe] to file [C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\Multiplatform Distribution.exe]
[WARNING]         No signing configuration found
[INFO]     Windows EXE file created in C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\Multiplatform Distribution.exe!
[INFO]
[INFO] App created in C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution!
[INFO]
[WARNING] Installer generation is disabled by 'generateInstaller' property!
[INFO] Creating bundles ...
[INFO] Bundles created!

It runs fine:

image

And here is the point:

[INFO]         Getting required modules ...
[INFO]             Executing command: cmd.exe /s /c ""C:\Program Files\GraalVM\graalvm-community-openjdk-21.0.2+13.1\bin\jdeps" -q --multi-release 21 --ignore-missing-deps --print-module-deps --add-modules=ALL-MODULE-PATH "--module-path=C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\multiplatform-distribution-1.1.0-SNAPSHOT-runnable.jar;C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs" "C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs" C:\Users\fvarrui\GitHub\multiplatform-distribution\multiplatform-distribution-client\target\multiplatform-distribution-1.1.0-SNAPSHOT-runnable.jar"
[INFO]             java.base,java.desktop,java.logging,java.naming
[INFO]         Required modules found: [java.base, java.desktop, java.logging, java.naming]

I've just released a snapshot version: 1.7.7-20240703.192610-1. Please, try it and give me some feedback.

P. S. @fvarrui Thank you very much for the excellent JavaPackager plugin!!!

Thanks! 😃

@fvarrui fvarrui added bug Something isn't working feedback Waiting for feedback labels Jul 3, 2024
@dbelob
Copy link
Author

dbelob commented Jul 4, 2024

I've just released a snapshot version: 1.7.7-20240703.192610-1. Please, try it and give me some feedback.

I tried the version 1.7.7-SNAPSHOT. Application runs, the set of modules is valid:

[INFO]         Getting required modules ... 
[INFO]             Executing command: cmd.exe /s /c "C:\Java\jdk21\bin\jdeps -q --multi-release 21 --ignore-missing-deps --print-module-deps --add-modules=ALL-MODULE-PATH "--module-path=C:\Projects\Java\multiplatform-distribution\multiplatform-distribution-client\target\multiplatform-distribution-1.1.0-SNAPSHOT-runnable.jar;C:\Projects\Java\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs" "C:\Projects\Java\multiplatform-distribution\multiplatform-distribution-client\target\Multiplatform Distribution\libs" C:\Projects\Java\multiplatform-distribution\multiplatform-distribution-client\target\multiplatform-distribution-1.1.0-SNAPSHOT-runnable.jar"
[INFO]             java.base,java.desktop,java.logging,java.naming
[INFO]         Required modules found: [java.base, java.desktop, java.logging, java.naming]

Good work, thanks a lot!

@fvarrui
Copy link
Owner

fvarrui commented Jul 4, 2024

Great! I'll release 1.7.7 ASAP
Thanks!

@fvarrui fvarrui added the fixed Issue fixed and release pending label Jul 4, 2024
@fvarrui
Copy link
Owner

fvarrui commented Jul 4, 2024

Branch issue-421 merged into devel, ready to be released in 1.7.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feedback Waiting for feedback fixed Issue fixed and release pending
Projects
None yet
Development

No branches or pull requests

2 participants