-
Notifications
You must be signed in to change notification settings - Fork 193
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
Incomprehensible problem - groovy.lang.GroovyObject cannot be resolved #1045
Comments
Thanks for reaching out for support. I'm glad to have a chance to ask questions and get this resolved. Stackoverflow is tough to have dialog/conversation. Yes indeed, Eclipse and the Groovy Development Tools (GDT) support Java 11. I have tried out Java 9, 10, 11, 12 and 13 to ensure support. There are a couple things I can say up front.
|
Thanks very much. Will try again with 2019-12... |
Thanks for the update. Let me know if you run into any problems. If you can capture a screenshot, that may help me understand where you ran into issues. |
So I try again: fresh placing of the extracted Eclipse 2019-12 files under /opt/eclipse
Cannot complete the install because one or more required items could not be found. |
Sorry, my fault. Eclipse 2019-12 is 4.14. https://dist.springsource.org/snapshot/GRECLIPSE/e4.14 You can double-check because the feature and plug-ins end with "e2003" and not "e1912" in the messages above. |
Thanks, yes, I did install the right version yesterday in fact. I tried both the correct snapshot and the correct release versions for 2019-12. So what happens there is: I install the GRECLIPSE "required" "Main Package". I create a new Groovy project, with a package under src called "test". Under that I make a file "test.groovy". First line of that:
So at that point I get both those errors: "- The type groovy.lang.MetaClass cannot be resolved. It is indirectly referenced from required .class files" & "- The type groovy.lang.GroovyObject cannot be resolved. It is indirectly referenced". I try cleaning the project, refreshing, closing and reopening Eclipse. Nothing doing. Then I thought I'd add the other two options (Maven support and different compiler levels)... once I've adjusted the Eclipse-wide and project to 2.5.x I still have the same 2 errors showing. I add a print line I try to run as a Groovy script: it doesn't print "hello world". Instead, the console shows this:
This is exactly what happened yesterday. |
Can you take a screenshot that includes your Package/Project Explorer with some expanded nodes and your Groovy Editor when this error is showing? |
Thanks again, I really appreciate your helping with this! I made the screenshot. I doubt whether it'll tell you anything new. Incidentally, you might be interested to know that I'm getting some unexpected errors when starting the Eclipse 2019-12 executable:
... and ... just to clarify: I simply expanded the Eclipse compressed file: I didn't follow a process of installation to install this version of Eclipse (or the one I'm currently using for my projects, 2019-06). How did you install your version of Eclipse? |
The messages in your log are normal. When the compile chooser bundle runs, it activates only one of the Groovy Compiler bundles. The others are uninstalled. And since you have the m2e logback bundle, this means a number of other bundles are refreshed as well. You can uninstall just logback if you want fewer warnings on startup: #981 (comment) I see you have module-info.java in your package root. Does this mean you have a modular project? Can you share your classpath/modulepath? Just a look at the .classpath file should do. Please note that modulepath entries are not very well supported for Groovy yet: #639 |
I don't know anything about module-info.java. As far as I'm aware I just accepted default choices when creating the Groovy project. Here's my .classpath file:
|
Ah yes, when I add module-info to project, the error shows for various missing types. If I delete module-info, it goes away. |
You can also add |
Thanks. I tried adding the line 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 be not be set However, when I deleted module-info.java I was indeed able to run the Groovy script ... it printed "hello". So thank you very much... I can't currently accept the answer you've added on SO: if you care to change your answer to "delete module-info.java", or alternatively try and sort out the still remaining difficulty I describe above... ? |
Can you file a separate issue for Run As > Groovy Script not working? I think that is a separate issue. You should be able to Run As > Java Application and it will run your script's contents if it is compiled to a class file. Run As > Groovy Script allows Groovy to do it's own compilation at runtime. You could also create unit tests to drive your code snippets. These should run fine as well. |
Normally I was, until I stopped a few months ago, using Groovy-Eclipse (i.e. Eclipse Groovy Projects) precisely for that purpose: Groovy scripts, and nothing else. I use Gradle projects if I ever want to put together a "proper" Groovy app. More pressing for me perhaps than the "Groovy Script not working" issue (because deleting module-info.java is no big deal) is the on-going problems with import groovy.sql.Sql, so I propose to start a new issue on that... Marking this closed. |
Is GroovyEclipse meant to work with Java 11?
Specs: Linux Mint 18.3, Eclipse 2019-06, Groovy 2.5.8, Java 11
I am unable to use GroovyEclipse in either Eclipse 2019-06 or Eclipse 2019-12. I have all sorts of issues and complaints when trying to install, and when I try to start a Groovy project and create the simplest possible Groovy file, I get “groovy.lang.GroovyObject cannot be resolved”.
Eclipse has been one of my most implacable foes for many years. I have tried many strategems to get this to work. Installing a fresh version of 2019-12 just produces the same error out of the box.
At the same time I have no problem with Eclipse Gradle projects, or running Groovy at the CLI. More details here.
The text was updated successfully, but these errors were encountered: