Search code examples
eclipsegroovysdkman

Using Eclipse with sdkman! installed Groovy on OSX


I have installed Groovy 3.0.2 using sdkman! on OSX 10.13.6 and 'which groovy' reports /Users/adrian/.sdkman/candidates/groovy/current/bin/groovy

But when I attempt to use Eclipse (2020-03 4.15.0) it won't pick up anything but the basic groovy packages - so hence code with imports like groovy.cli.commons.CliBuilder (the jar for that is in ~/.sdkman/candidates/groovy/current/lib) fail.

How do I fix this? (I can see no obvious way and I cannot even pick a directory name that begins with . in the IDE tools)


Solution

  • Eclipse does not use your sdkman install. The Groovy Development Tools supply their own Groovy libs. For Groovy 2.5 and 3, that means groovy and groovy-test. If you want additional modules, you can add them to your ~/.groovy/lib directory. Or add Ivy, Maven or Gradle support to your project for more advanced dependency management.