本文介绍了在Mac上为IntelliJ设置JDK 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里通过从Oracle网站下载dmg安装了JDK:

对于较旧的jdk图像,如1.6或之前,您需要确保所有来自<$ c $的罐子c> /Library/Java/JavaVirtualMachines/jdkXYZ_VERSION.jdk/Contents/Home/jre/lib 目录(charsets.jar,jce.jar,JObjC.jar,jsse.jar,management-agent。 jar,resources.jar和rt.jar)是你设置的一部分。


I installed the JDK by downloading the dmg from the Oracle website here: http://www.oracle.com/technetwork/java/javase/downloads/jdk7u9-downloads-1859576.html

After installation I tried to setup the JDK in IntelliJ but when I set the location to the JDK in the Project Structure->SDKs screen, only a few libraries were loaded and many (including all libraries from Content/Classes/) were missing.

How can I add all of the necessary libraries?

The install location for the JDK is /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home

I've tried looking in /System/Library/Frameworks/JavaVM.framework/Versions/ to no avail.

解决方案

Under Project Structure -> Platform Settings -> SDKs.

By using '+' sign, you should add a valid JDK, that will take care and add the proper libraries, eg. /Library/Java/JavaVirtualMachines/jdk-XYZ.jdk/Contents/Home

For jdk images older, like 1.6 or before, you need to ensure that all the jars from /Library/Java/JavaVirtualMachines/jdkXYZ_VERSION.jdk/Contents/Home/jre/lib directory too (charsets.jar, jce.jar, JObjC.jar, jsse.jar, management-agent.jar, resources.jar and rt.jar) are part of your setup.

这篇关于在Mac上为IntelliJ设置JDK 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 17:49