Creating a new Java project in IntelliJUpdated: 3 years ago
Check out other lessons in Learning the Java syntax
We are going to create a command line Java application that'll be able to show some text on our computer screens.
Start by opening IntelliJ.
This is the startup screen that IntelliJ shows you when you open it. Just click the new project button and a new window will show the available project templates.
We won't need any additional libraries or frameworks so keep everything unchecked. Make sure that under
Project SDK Java 1.8 is selected. If it's missing just press the new button and setup a new JDK. Point it to the folder where you installed the JDK. Once everything is setup, click next.
We want to create a command line application so first check the
Create project from template box and then select the Command Line App option.
This is the last screen that you need to fill out. You can put whatever under
Project name and choose a location for your project.
Base package is used as a unique identifier for your project and can be changed at any point. I'll be putting com.codescrubs as my package name while your package name can be whatever you want. The established naming convention is to use your domain name in reverse order.
Wait a couple of seconds and IntelliJ will generate an empty Java command line app for you to use. Let's find out how the template looks and works.