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

When packaging modular projects with jpackage, module names can't start with "app." #452

Open
3298636952 opened this issue Oct 18, 2023 · 0 comments

Comments

@3298636952
Copy link

3298636952 commented Oct 18, 2023

When using jpackage to package a modular project, after importing this module, the module name cannot start with app.

Here's a minimal example: https://github.com/beryx-gist/jnativehook-modular-demo

This example works perfectly. However, when you change the application's module name to start with app., the packaged result with jpackage fails to run.

build.gradle:

application {
    mainModule = "org.jnativehook.demo"  // Change to "app.jnativehook.demo"
    ...
}

jpackage {
    imageOptions += ["--win-console"]  // To see the error messages
    ...
}

module-info.java

module org.jnativehook.demo { 	//  Change to "app.jnativehook.demo"

    // When using this module, surprisingly the application module name cannot start with 'app.' or 'bpp.', but it can start with 'cpp.' or 'dpp.'?
    // Otherwise, an error will occur when running the packaged result with jpackage:
    //      Error: A JNI error has occurred, please check your installation and try again.
    //              Exception in thread "main" java.lang.InternalError: Module app.jnativehook.demo not in boot Layer.
    //              at java.base/sun.launcher.LauncherHelper.loadModuleMainClass(Unknown Source)
    //              at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
    requires com.github.kwhat.jnativehook;
    opens org.jnativehook.example;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant