简体   繁体   English

如何在GGTS中正确配置JDK位置(Groovy Grails工具套件)

[英]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: 在Mac OS X 10.9 Mavericks上运行的GGTS中创建新项目时收到以下错误:

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: 在这里和互联网上的其他地方搜索,解决方案是使用1.7 JDK而不是1.8运行GGTS我安装了1.7,但我的默认Mac OS JDK是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? 但我的问题是: 如何配置GGTS本身(而不是项目)以使用不同的JDK启动?

When I go into GGTS and go to About > Installation Details > Configuration I see: 当我进入GGTS并转到About> Installation Details> Configuration时,我看到:

-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. 我安装了几个1.7 JDK,如果我知道如何,我可以指出。

For what it's worth my $JAVA_HOME is set to: 值得我将$ JAVA_HOME设置为:

/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. 如果系统上存在另一个jdk并不重要,您可以在GGTS中使用其他jdk。 Just add another JDK using Window>Preferences>Java>Installed JREs . 只需使用Window> Preferences> Java> Installed JRE添加另一个JDK。 Then at that page click on add and find your JDK location. 然后在该页面上单击添加并找到您的JDK位置。 Finally select the default one for GGTS to use. 最后选择GGTS使用的默认值。 Thats all. 就这样。

To customize which JDK the GGTS application uses, update the GGTS.ini file. 要自定义GGTS应用程序使用的JDK,请更新GGTS.ini文件。 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 对于我的安装,GGTS.ini位于

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

Note that this only sets the JDK that GGTS is running on. 请注意,这仅设置运行GGTS的JDK。 You'll still want to update your Eclipse preferences and project settings as necessary. 您仍然希望根据需要更新Eclipse首选项和项目设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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