- Visit the IntelliJ IDEA download page and download the Community Edition.
- Follow the installation instructions based on your operating system.
-
Open IntelliJ IDEA after installation.
-
Click on "Create New Project" or go to
File>New>Project. -
Select "Java" on the left sidebar and choose "Java" as the Project SDK.
-
Click "Next."
-
Enter a Project Name (e.g., HelloWorld) and click "Finish."
-
In the Project Explorer, locate the "src" folder.
-
Right-click on the "src" folder and choose
New>Java Class. -
Name the class (e.g., HelloWorld) and click "OK."
-
Inside the class, write a simple Java Hello World program:
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }
-
Open IntelliJ IDEA and go to
View>Tool Windows>Terminal. -
In the terminal, type the following command to set Git Bash as your default terminal:
git config --global core.autocrlf input
5.1 Check Status
Before making a commit, check the status of your repository:
git status5.2 Stage Changes
Stage the changes you want to commit:
git add .You can also stage specific files:
git add file1.txt file2.java5.3 Commit Changes
Commit the staged changes with a descriptive message:
git commit -m "add: Hello world project"5.4 Push Changes to Remote Repository
Push the committed changes to the remote repository (replace main with your branch name):
git push origin main