简体   繁体   中英

How to properly configure the JDK location in GGTS (Groovy Grails Tools Suite)

I receive the following error when creating new Projects in GGTS running on Mac OS X 10.9 Mavericks:

Groovy:Repetitive method name/signature for method 'java.lang.Object
withFormat(groovy.lang.Closure)' in class 
'grails.plugin.databasemigration.DbdocController'.

Searching here and elsewhere on the internet, the solution is to run GGTS with a 1.7 JDK instead of 1.8 I have 1.7 installed, but my Default Mac OS JDK is 1.8:

Running:

 /usr/libexec/java_home 

Results in:

/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home

A few searches here claim that this is very difficult to change. But my question is: How can I configure GGTS itself (not the project) to startup with a different JDK?

When I go into GGTS and go to About > Installation Details > Configuration I see:

-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk

in the output. There must be a way to configure this somehow? I have several 1.7 JDKs installed that I could point at if I knew how.

For what it's worth my $JAVA_HOME is set to:

/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home

It does not matter if there exists another jdk on the system, you can use others in GGTS. Just add another JDK using Window>Preferences>Java>Installed JREs . Then at that page click on add and find your JDK location. Finally select the default one for GGTS to use. Thats all.

To customize which JDK the GGTS application uses, update the GGTS.ini file. Add the following two lines to the top of the file:

-vm
/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home

For my installation, GGTS.ini is located at

~/springsource/ggts-3.5.0.RELEASE/GGTS.app/Contents/MacOS

Note that this only sets the JDK that GGTS is running on. You'll still want to update your Eclipse preferences and project settings as necessary.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM