Mac OS 上的 IntelliJ IDEA JDK 配置

Mac OS 上的 IntelliJ IDEA JDK 配置

问题描述:

我使用的是 IntelliJ IDEA 10.每次创建新项目时,都会要求我为该项目选择 JDK.有谁知道我如何配置它并使其易于使用?

I am using IntelliJ IDEA 10. Every time when I create a new project, it is asking me to choose JDK for this project. Anyone know how I can configure it and make it easy to use?

如果您使用的是 Mac OS X 或 Ubuntu,则问题是由 JDK 的符号链接引起的.档案 |无效缓存应该会有所帮助.如果没有,请指定直接 JDK 主文件夹的 JDK 路径,而不是符号链接.

If you are on Mac OS X or Ubuntu, the problem is caused by the symlinks to the JDK. File | Invalidate Caches should help. If it doesn't, specify the JDK path to the direct JDK Home folder, not a symlink.

Invalidate Caches 菜单项位于 IntelliJ IDEA File 菜单下.

Invalidate Caches menu item is available under IntelliJ IDEA File menu.

最近 Apple Java 更新后的直接 JDK 路径是:

Direct JDK path after the recent Apple Java update is:

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

在IDEA中,您可以在文件|中配置新的JSDK.项目结构,在左边选择SDKs,然后按[+]按钮,然后指定上面的JDK home路径,你应该得到这样的:

In IDEA you can configure the new JSDK in File | Project Structure, select SDKs on the left, then press [+] button, then specify the above JDK home path, you should get something like this: