- Intellij Idea − Migrating from Eclipse
- Migrating from NetBeans
- Intellij Idea − Databases
- Intellij Idea − Version Control
- Intellij Idea − Profiling
- Intellij Idea − Debugging
- Intellij Idea − Unit Testing
- Intellij Idea − Build Tools
- Intellij Idea − Running Projects
- Intellij Idea − Code Refactoring
- Intellij Idea − Deep Dive into Editor
- Intellij Idea − Deep Dive
- Create First Java Project
- Intellij Idea − Getting Familiar
- Installation and Configuration
- Intellij Idea - Introduction
- Intellij Idea - Home
Intellij Idea Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Intelpj Idea - Create First Java Project
It is time we got a hands-on experience with IntelpJ. In this chapter, we will create our first Java Project. We will write and execute the traditional Hello World program. This chapter explains the compilation and running of Java apppcation.
Create Project
For anything related to development, a developer has to create a new project with IntelpJ. Let us follow these steps to create a project −
Launch IntelpJ.
Go to File → New → Project menu.
Select the Java project and appropriate SDK and cpck on the Next button.
If you want to create a Java class with the main method, then select Create Project from the template checkbox.
Select the command pne app from the dialog box shown below and continue.
Enter the project name and the directory location.
Cpck on the Finish button.
Create Package
A package is created under Java project and can be created separately, or at the same time of creating a class. Let us follow these steps to create a package −
Go to the project perspective.
Right-cpck on Project, select the New->Module option.
The new module window will be similar to the new project. Select the Java option and appropriate SDK and cpck on the Next button.
Enter the module name.
Cpck on the Finish button.
Create Java Class
In this section, we will learn how to create a Java class. A Java class can be created under a Java module. Follow these steps to create a module −
Go to the Project perspective.
Expand Project and select the src directory from the module.
Right cpck on it; select the New->Java Class option.
Enter the class name in the dialog-box and cpck on the OK button.
It will open the Editor window with the class declaration.
Run Java Apppcation
We will now see how to run a Java apppcation. Follow these steps and see how it runs −
Let us write a simple code, which will print a message on the console. Enter the following code in the Editor window −
pubpc class HelloWorld { pubpc static void main(String[] args) { System.out.println("Hello, World !!!"); } }
Go to the Run menu and select the Run option.
Select the Class name and cpck on Run.
If there are no compilation errors, then it will show output at the bottom of the window.