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

java.lang.module.FindException #1067

Closed
mictadlo opened this issue Mar 26, 2020 · 12 comments
Closed

java.lang.module.FindException #1067

mictadlo opened this issue Mar 26, 2020 · 12 comments

Comments

@mictadlo
Copy link

Hi,
I download eclipse-jee-2019-12-R-linux-gtk-x86_64.tar.gz and installed the stable groovy-eclipse plugin.

However, println "hello" // a comment till the end of the line caused:

OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "groovy.lang.GroovyClassLoader"). To use archived non-system classes, this property must not be set
Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for /home/ubuntu/JavaApps/eclipse/plugins/org.codehaus.groovy_2.4.17.v201912311228-e1912-RELEASE/lib/groovy-all-2.4.17.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class moduleName=groovy-all not in module

What did I miss?

Thank you in advance,

Michal

@eric-milles
Copy link
Member

Can you describe the kind of project you created and how you are trying to run your script? I suspect some of the Java 9+ changes are impacting you. I can suggest some workarounds if I can get some more info on what you're trying to do.

I am also presently trying to make changes to support JPMS (modular) projects. But the support is incomplete even in the current snapshot builds.

See also #1059 #1050 #1045 #639

@mictadlo
Copy link
Author

I did it from scratch and now it seems to work with some warnings:

File -> New -> Groovy Project ...
Project Name: Test2
JRE
Use an execution environment JRE: JavaSE-13
Finish
File -> New -> Other ...
Groovy Type
Source Folder: Test2/src
Kind: script
Name: Hello
Finish
Hello.groovy:
println "hello" // Ran as Groovy script and got few warnings
OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "groovy.lang.GroovyClassLoader"). To use archived non-system classes, this property must not be set
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/home/ubuntu/JavaApps/eclipse/plugins/org.codehaus.groovy_2.4.17.v201912311228-e1912-RELEASE/lib/groovy-all-2.4.17.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
hello

Do I use Groovy 3 or 2.4.17?

Thank you in advance,

Michal

@eric-milles
Copy link
Member

When you created the project, did it ask to create a module-info.java? That is, does your project now have a module-info.java at the root of the source folder?

I have just finished building a snapshot version that will default to no module-info.java for a new Groovy Project. This should help with small projects for experimenting with Groovy.

@eric-milles
Copy link
Member

Groovy 3 will give you the fewest illegal access warnings at runtime. I suggest using it unless you have a specific need to use 2.4 or 2.5.

@mictadlo
Copy link
Author

Yes, it did ask to create module-info.java and complained that project name started with uppercase. Therefore, I declined to create it.

In the Groovy project, I have Groovy Libraries and it contains:

  • groovy-all-2.4.17.jar
  • ivy- 2.4.0.jar

However, on my system I have:

$ groovy -v
Groovy Version: 3.0.2 JVM: 13.0.1 Vendor: Private Build OS: Linux

How do I know which version groovy-eclipse is using?

Thank you in advance,

Michal

@eric-milles
Copy link
Member

Window > Preferences > Groovy > Compiler will show which compiler version is active and provides controls for switching to others.

@mictadlo
Copy link
Author

Thank you, the current Groovy compiler is 2.4.17 but I can not find how to change it. Could you please pin point where can I find how to change it?

Thank you in advance,

Michal

@eric-milles
Copy link
Member

If there were no buttons to switch to another version, you will need to install additional compilers first. You can do so under Help > Install New Software...

@mictadlo
Copy link
Author

Oops, I found it now but it only shows 2.4 or I don't care. I installed Groovy via SDKMAN. What should I use as a URL for Groovy in Help > Install New Software...?

Thank you in advance,
Michal

@eric-milles
Copy link
Member

Update site URL depends on the release of eclipse you are using. Releases at the top, snapshots below: https://github.com/groovy/groovy-eclipse/wiki#releases

@mictadlo
Copy link
Author

Thank you, I installed the snapshot and now I am able to chose from 2.4, 2.5 and 3. Do you think it would be possible to choose the Groovy compiler while creating the the Groovy project?

Thank you in advance,

Michal

@eric-milles
Copy link
Member

See #396

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

2 participants