Task creating content with intellij
Developing new function with IntelliJ IDEA¶
Creating a new project¶
To add a new project to intellij, select New
then Project
from the File
top-level menu of IntelliJ.
Select Java
then set up the project SDK by selecting your Java 17 installed JDK and then click the Next
button.
If this is the first time you are using IntelliJ you may need to click on the New...
button and navigate to your install directory.
Leave the Create project from template
option blank and simply click the Next
button.
Add the name of the project in Project name
and the directory where you want the project files to be stored in Project location
.
Click on the Finish
button. If the directory is new, you may get this pop-up to confirm that the directory should be created. Click OK
.
Once the wizard completes IntelliJ will open up your new project, ready to begin coding. The src
directory is where your code will go.
Creating a new java package¶
To add a new Java package to your project, right-mouse click on the java
directory.
Select New
then Package
on the sub menu.
A pop-up box appears asking for the name of the package. Enter your new package name and press the OK
button.
Java package names are in lowercase and are dot (.
) separated.
The new package appears under src
in the project list.
Creating a new java class¶
To add a new Java class to your project, right-mouse click on the package name and select New
then Java Class
on the sub menu.
A pop-up box appears asking for the name of the class. Enter your new class name and press the OK
button.
The new class appears in the project list and the source file is open in the editor.
Adding changes to Git¶
Any changes, additions and deletions that you make to the files under the git repository directory are automatically detected by git. It is possible to add these changes to your clone using the Add option on the Git right-mouse menu.