idea 中支持编译build,构建语言一般需要一个sdk。
1.什么是sdkidea官方原文如下:
Every project uses a Software Development Kit (SDK). For Java projects, SDK is referred to as JDK (Java Development Kit). The SDK determines which API library is used to build the project. If a project is multi-module, the project SDK is common
for all modules within the project by default. Optionally, a project can configure an individual SDK for each module. For more information about SDKs, see Working with SDKs in the IntelliJ IDEA Web Help. 翻译后: 每个项目都使用软件开发工具包(SDK)。对于Java项目,SDK被称为JDK(Java开发工具包)。SDK决定了哪个API库被用来构建项目。如果一个项目是多模块的,默认情况下,项目的SDK对项目中的所有模块来说是通用的。作为选择,项目可以为每个模块配置单独的SDK。 关于SDK的更多信息,请参见IntelliJ IDEA网络帮助中的使用SDK。
Generally, SDKs are global. It means that one SDK can be used in multiple projects and modules. After you create a new project and
define an SDK for it, you can configure modules in this project to inherit its SDK. You can also specify an SDK for each module
individually. For more information, refer to Change module SDK.
翻译后:
一般来说,SDK是全球性的。这意味着一个SDK可以在多个项目和模块中使用。在你创建了一个新项目并为其定义了一个SDK后,你可以配置这个项目中的模块来继承其SDK。您也可以为每个模块单独指定一个SDK。更多信息,请参考改变模块的SDK。
2. 获取和创建sdk信息Sdk projectSdk = ProjectRootManager.getInstance(project).getProjectSdk();
3. 创建自定义sdk
标签:模块,getInstance,idea,project,源码,ProjectRootManager,sdk,SDK From: https://www.cnblogs.com/yuluoxingkong/p/16657693.html