英文:
Why IntelliJ Idea cannot find location of GO SDK?
问题
- 我下载了go1.4.darwin-amd64-osx10.8.tar.gz并将其解压到本地目录。
- 根据Installing to a custom location所说,我在环境变量中添加了GOROOT。
- 根据Test your installation所说,我创建了一个go文件。
- 最后我运行了它,并得到了预期的结果,如下所示的截图。
- 实际上,我使用的是IntelliJ v.14,但是根据这篇文章,我在我的IntelliJ Idea中安装了
Go Language (golang.org)
版本0.9.15.3。 - 我创建了一个Go项目,在创建过程中它要求我添加GO SDK。我给了它
~/Desktop/go/sdk
,但它无法识别它。在事件日志中我得到了以下错误:
> 14:03:02 IllegalArgumentException: Argument for @NotNull parameter
> 'virtualFile' of
> com/intellij/openapi/projectRoots/impl/ProjectRootContainerImpl.addRoot
> must not be null
有任何关于IntelliJ Idea如何识别它的想法将不胜感激。谢谢。
英文:
- I downloaded go1.4.darwin-amd64-osx10.8.tar.gz and extract it on my local directory.
- Based on what Installing to a custom location says I added GOROOT in env variable.
- Based on what Test your installation says I created a go file.
- I finally ran it and I got expected result as following screenshot.
- I actually have IntelliJ v.14 however, based on this article I installed
Go Language (golang.org)
version 0.9.15.3 in my IntelliJ Idea. - I created a Go project and during creation it asked me to add GO SDK. I gave it
~/Desktop/go/sdk
however it wasn't able to recognise it. I got this error in Event Log:
> 14:03:02 IllegalArgumentException: Argument for @NotNull parameter
> 'virtualFile' of
> com/intellij/openapi/projectRoots/impl/ProjectRootContainerImpl.addRoot
> must not be null
Any idea how IntelliJ Idea is able to recognize it would be appreciated. Thanks.
答案1
得分: 10
请考虑使用0.9.16版本的alpha发布之一。我认为alpha7可能比alpha9更稳定。你可以从GitHub releases获取它们。
v1.0.0-alpha0分支是一个alpha版本,正如其名称所示,它处于开发的早期阶段,这就是为什么还没有发布的原因。
附言:我是该插件的贡献者之一。
英文:
Please consider using one of the alpha releases for 0.9.16. I believe that alpha7 could be the more stable one rather than alpha9. You can get them from GitHub releases
The v1.0.0-alpha0 branch is, as the name implies, an alpha release and it's in the early stages of development, that's why there's no release done yet for it as well.
P.S. I'm one of the contributors to the plugin.
答案2
得分: 2
不允许在Mac Yosemite下使用位于/usr/local/go(完全有效和最新的SDK)的SDK。
Google App Engine也不识别最新的有效GAE GO SDK。
英文:
Does not allow to use SDK placed in /usr/local/go (perfectly valid and recent SDK) under Mac Yosemite.
Google App Engine does not recognise last valid GAE GO SDK either.
答案3
得分: 1
~Desktop/go/sdk
似乎不是一个有效的路径(因为它引用了“Desktop”用户的主目录):~/Desktop/go/sdk
应该更好地工作。
只要在 ~/Desktop/go/sdk
文件夹中看到子文件夹 api
、bin
、blog
等,那应该就是“golang support plugin”所期望的正确路径。
该插件与 IntelliJ 14 存在一些问题:issues 1169,PR 1172(已修复为 1.0.0-alpha 版本)。
另一种方法是重新编译和安装该插件。
指定 Go SDK 路径的最终结果应该如下所示:
英文:
~Desktop/go/sdk
doesn't seems a valid path (as it refers to the homedir of the 'Desktop
' user): ~/Desktop/go/sdk
should work better.
As long as you see in that ~/Desktop/go/sdk
folders the subfolders 'api
', 'bin
', 'blog
', ..., that should be the right one for the GO SDK expected by the "golang support plugin".
Some issues exist with that plugin and IntelliJ 14: issues 1169, PR 1172 (fixed for for 1.0.0-alpha).
The other approach is to recompile and install that plugin.
The end result of specifying the Go SDK path should look like:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论