Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 3 Next »

Hello World application

  1. Open your IntelliJ IDEA and click on ‘New Project’.

  2. Make sure Java is selected on the left hand side and Java 11 as Project SDK. Click Next.

  3. You can select the tick-box presented on the next page - the project will be created to accommodate for command line application style code and click Next.

  4. On the next page, type in the name of your project - HelloWorld, you can accept the default location where the project will be created, just make a note of it. And in the last text box type in com.virtual1. Click Finish.

  5. Your project will be created and opened in your IntelliJ. You should see a file called Main.java. It contains a class definition with a main method. That's where we will place our code.

  6. Type in System.out.println("Hello world!"); inside the main method.

  7. Run your application - right-click into the Main.java file and select Run.

  8. After a short while, you should see a similar output at the bottom part of your IntelliJ window.

  9. Congratulations, you created your first Java application!

Note: Indentation shortcut for IntelliJ Ctrl+Alt+I (letter ‘eye’) or Ctrl+Option+I for Mac.

Note: Quick comment shortcut Ctrl+/ or Command+/.

  • No labels