Creating a Java Project

You can create two types of Java projects in MindStudio: Java and Gradle. Methods of creating these projects are similar. The following example describes how to create a Java project of the Java type.

Creating a Java Project

  1. Navigate to the project creation window.
    • On the MindStudio welcome page, click New Project.
    • On the MindStudio project page, choose File > New > Project... from the top menu bar.
  2. In the New Project dialog box, choose Java and set project parameters, as described in Table 1.
    Table 1 Project parameters

    Parameter

    Description

    Project SDK

    Software package required by the JDK.

    Additional Libraries and Frameworks

    Python is displayed by default. If this option is selected, you can choose a configured Python SDK from Python SDK. For details about how to configure the Python SDK, see Python SDK Dependency Settings.

  3. Click Next. On the New Project page, determine whether to create a project file from the template.
    • Yes: Based on the template, a project with code will be generated.
    • No: No code file is generated. You need to create one.
  4. Click Next to set the project parameters, as described in Table 2.
    Table 2 Project parameters

    Parameter

    Description

    Project name

    Project name (user-defined).

    Project location

    Default path for saving a project (user-defined). (For users who use MindStudio for the first time, the default value is $HOME/MindstudioProjects)

    More Settings

    Module name: module name, the same as the Project name.

    Content root: path in the root directory.

    Module file location: module file path.

    Click the check box on the right of Project format. A drop-down list is displayed.
    • .idea (directory-based) (default option): During project creation, an .idea project directory is created to save the project information.
    • .ipr (file-based): project configuration file used to save the project configuration information.
  5. Click Finish.

    If there is already an active project in the window, a confirmation message is displayed.

    • Click This Window to open the newly created project in the current window.
    • Click New Window to open the newly created project in a new window.
  6. After a project is created, the project directory is displayed in a tree structure (subject to the actual creation result).

    Choose File > Project Structure… from the top menu bar. In the displayed window, select SDKs in the left function pane, click + in the right function pane, and select Download JDK to download the SDK of the Java project.

    (The default access address of the JDK is https://download-cdn.jetbrains.com/jdk/feed/v1/jdks.json.xz.)

Importing a Java Project

  1. Import the project file.
    • On the MindStudio welcome page, click Open, select the project to be imported, and click OK.
    • On the MindStudio project page, choose File > Open... from the top menu bar or click on the menu bar to select an existing project and open it.

    If a project has code risks, the trust window is displayed when you open the project.

    • If the project source code is trusted and secure, click Trust Project. (You can select Trust projects in <workspace_directory> to trust all projects in the directory.)
    • If the project is not trusted and you only want to view the source code, click Preview in Safe Mode to preview the project in safe mode.
    • To cancel opening the project, click Don't Open.
  2. If there is already an active project in the window, a confirmation message is displayed.
    • Click This Window to open the project in the current window.
    • Click New Window to open the project in a new window.
  3. After the project is imported, find the project directory displayed in a tree structure (subject to the actual creation result).