My Linux machine has OS : Ubuntu 18.04.3 LTS Currently it has groovy version:

build@###: $  groovy -version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/share/groovy/lib/groovy-2.4.16.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
Groovy Version: 2.4.16 JVM: 11.0.5 Vendor: Private Build OS: Linux

I want to downgrade it to 1.8.6

Please guide

2 Answers 2


I did not find groovy 1.8.6 in the default apt repos. Unless you find a repo that supports it, you should do it by hand. The problem is that 1.8.6 is very old and I did not find the files even at the apache groovy site. Some of the jars are available here e.g. you can donwload the groovy-all jar. With that you should be able to run any compiled classes adding this to your classpath. Set the JAVA_HOME to some proper version of java, I guess I would try a Java 6 or 7. Otherwise recompile your sources, if you have them, with a newer version of groovy. That might need some fixing of the code.

  • Thanks for your response. I have java 8 installed in my system. openjdk version "1.8.0_232" OpenJDK Runtime Environment (build 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09) OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode) Not sure, How do i proceed Jan 20, 2020 at 8:20
  • export the JAVA_HOME to the path of where you installed java8, next export PATH= $JAVA_HOME/bin:$PATH, download the groovyall jar from the link I gave you. Set the CLASSPATH to include your class files and the groovy-all-1.8.6.jar and finally run your main class Jan 21, 2020 at 9:37

Here is a link to the binary: https://bintray.com/version/files/groovy/maven/groovy/1.8.6

Update 1

How to install:

$ unzip groovy-binary-1.8.6.zip
$ sudo mv ./groovy-1.8.6 /usr/share/groovy-1.8.6
$ sudo update-alternatives --install "/usr/bin/groovy" "groovy" "/usr/share/groovy-1.8.6/bin/groovy" 186
  • It would be more useful if you could add the instructions to add the binary to the system ;-)
    – kashish
    Jul 14, 2020 at 5:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .