Creating a Java Project

Java Project Creation Method

  1. Navigate to the project creation window.
    • On the MindStudio welcome page, choose Project from the left menu and click New Project on the right.
      Figure 1 Project creation page
    • On the MindStudio project page, choose File > New > Project... from the top menu bar.
  2. In the New Project window, select New Project from the left menu and set project parameters, as described in Table 1.
    Table 1 Parameters

    Parameter

    Description

    Name

    Project name (user-defined).

    Location

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

    Create Git repository: indicates whether to create a Git repository. A repository can be created only after this option is selected.

    Language

    Select Java or Python, or click + on the right to select more. Select Java when creating a Java project.

    Build system

    Select a build system. The options are IntelliJ or Gradle.

    If you select Gradle, the Gradle DSL option is added, for which you can select Groovy or Kotlin.

    JDK

    Select a JDK from the drop-down list on the right.

    • Download JDK: downloads a JDK.
    • Add JDK: adds a JDK from a local directory.

    Add sample code

    Add sample code or not. If this option is selected, sample code is created in the src directory.

    Advanced Settings

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

    Content root: path in the root directory.

    Module file location: module file path.

  3. Click Create. A project is created.

    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.
  4. After the project is created, find the project directory displayed in a tree structure (subject to the actual creation result).

    You can also 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.