3.2. Opening an Existing Project
- Opening an imported project
-
If the project has already been opened by CUBA Studio on this computer, do the following:
-
Use recent projects list; or click Open, select the project’s folder in the file system dialog and click Open button.
-
Wait for Gradle synchronization and project indexing process to complete. As soon as the CUBA project tree appears in the Project tool window, you can start working with the project.
-
- Opening a project for the first time
-
If the project has not been opened by CUBA Studio on this computer, for example, just checked out from VCS, do the following:
-
Click Open and select the project’s
build.gradle
file in the file system dialog, then click Open button. -
Select Open as Project in the Open Project dialog.
-
In the Import Project from Gradle dialog:
-
Select Use auto-import checkbox.
-
Select
Use JAVA_HOME
in Gradle JVM field. If you don’t see such item in the drop-down list, make sure you have set up your development environment correctly as described in the Setup section of the CUBA Developer’s Manual. -
Click OK.
-
-
Wait for Gradle synchronization and project indexing process to complete. The CUBA project tree should appear in the Project tool window.
-
Click File > Project Structure in the main menu.
-
Make sure that the Project SDK field has a value corresponding to
JAVA_HOME
which is set in your environment. If you see the<No SDK>
value, click New and select the folder where the JDK is installed, for exampleC:\Java\jdk8u202-b08
on Windows or/Library/Java/JavaVirtualMachines/jdk8u202-b08/Contents/Home
on macOS. -
Make sure that the Project language level field has a value corresponding to the JDK version. For example, if the JDK is
1.8
, the language level must be8 - Lambdas, type annotations, etc.
-
-
- Opening a project based on CUBA 6.10 for the first time
-
CUBA Studio supports projects based on CUBA 6.10+ and 7.0. You can open your existing projects created in a previous version of Studio and import them into the new Studio.
Keep in mind that CUBA 6.10 supports only Java 8, so your
JAVA_HOME
environment variable must point to the JDK 8 installation. Later after migrating to CUBA 7, you will be able to use a newer JDK if needed.Follow the steps below to open an existing project based on CUBA 6.10 for the first time:
-
If your project uses premium add-ons (Reports, BPM, etc.) and you have a subscription, you should set the premium repository access credentials in
~/.gradle/gradle.properties
as described in the documentation. -
Remove old IntelliJ project files using the
gradlew cleanIdea
task in the command line. -
If the project is under Git version control, add
.idea
line to the.gitignore
file located in the project root. It will ensure your local IDE settings will not be shared between all developers of the project. -
Open
build.gradle
file as described in the Opening a project for the first time section above.
-