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

Having 'native' part in jar name for unnamed module case leads to exception #4620

Closed
andrejusc opened this issue Jun 2, 2022 · 4 comments
Closed
Assignees

Comments

@andrejusc
Copy link

Describe the issue
Having single Java class com.example.Hello.class (class name/content in this case is not relevant) inside jar called my-pseudo-native.jar and placing that jar into libs subfolder and invoking then command like such:
java -p libs com.example.Hello
leads to such exception:

Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for libs/my-pseudo-native.jar
Caused by: java.lang.IllegalArgumentException: my.pseudo.native: Invalid module name: 'native' is not a Java identifier

Steps to reproduce the issue
Explained above

Describe GraalVM and your environment:

  • GraalVM version 22.1.0
  • JDK major version: 17
  • OS: Oracle Linux 8u5
  • Architecture: x86_64
@oubidar-Abderrahim
Copy link
Member

Thank you for reporting this, we will take a look into it and get back to you

@andrejusc
Copy link
Author

Any update here?

@dougxc
Copy link
Member

dougxc commented Jun 22, 2022

This is a limitation of automatic modules names and is not specific to GraalVM: https://stackoverflow.com/questions/46501388/unable-to-derive-module-descriptor-for-auto-generated-module-names-in-java-9

@dougxc dougxc closed this as completed Jun 22, 2022
@andrejusc
Copy link
Author

I see, so essentially all keywords from here:
https://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.9
will cause similar issue with automatic modules, i.e. like with abc-continue-1.2.3.jar:

$ java -p . --list-modules
Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for ./abc-continue-1.2.3.jar
Caused by: java.lang.IllegalArgumentException: abc.continue: Invalid module name: 'continue' is not a Java identifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants