Getting Started with Java

Install Java, then go from choosing an editor to using streams in under 30 minutes with the Foojay Java Quick Start.

58,489 views

Is Java your first programming language and do you want to get up and running fast? Or maybe you are already an experienced programmer in another language and want to give Java a try?

Let Foojay.io, Friends Of OpenJDK, help you get started!

1. Install Java

Let’s first check if you already have Java installed. If not, we provide step-by-step instructions for each operating system below.

  • Check your Java installation

    How to find out whether Java is already installed and which version you have, using java -version in a terminal on Windows, macOS or Linux.

  • Find Another Java Version

    Which Java distribution to install? OpenJDK is the source; the runtime you install comes from a distribution. An overview of the free builds you can choose between.

  • Install Java on Linux

    Install Java on Linux with a Debian package installer, and find the other distributions and versions available for your system.

  • Install Java on MacOS

    Install Java on macOS with a ready-made installer, for both Intel and Apple silicon Macs.

  • Install Java on Windows

    Install Java on Windows with an MSI installer, then check the installation from the command prompt.

2. Get Started

Let’s go from choosing an editor to using the latest Java language features.

11 steps, under 29 minutes in total

  1. Choosing an Editor1:07

    Java Quick Start Tutorial: Learn how to choose the right Java editor or IDE for your workflow, from lightweight tools like VS Code to full-featured options such as IntelliJ IDEA, NetBeans, and Eclipse.

  2. Hello World!2:42

    Java Quick Start Tutorial: Write and run your first Java program with a simple Hello World example, including the Java 25 shorthand syntax and the classic class-based approach.

  3. Using Arguments and String Arrays2:10

    Java Quick Start Tutorial: Use the start-up arguments of the main method to learn Java arrays: their length, and how to loop through them.

  4. Working with Numbers2:08

    Java Quick Start Tutorial: The Java number types you will actually use - int, float, double and long - and how to work with them.

  5. If, Then, Else3:14

    Java Quick Start Tutorial: Compare values and branch on the result with if, then and else - the most-used construct in any programming language.

  6. Enum and Switch2:45

    Java Quick Start Tutorial: Replace loose integer values with an enum, and use a switch to react to each of its options in Java.

  7. Using Methods2:32

    Java Quick Start Tutorial: Split a Java program into methods to keep the code simple, readable and maintainable long after you wrote it.

  8. Using Objects4:07

    Java Quick Start Tutorial: Java is object-oriented: turn part of your program into an object with its own variables and methods.

  9. Reading a Text File5:39

    Java Quick Start Tutorial: Read a CSV file from disk in Java, combining files, loops and objects into one small working program.

  10. Using Streams2:53

    Java Quick Start Tutorial: Streams, added in Java 8, let you chain steps over a collection. Extend the text-file example with filtering and mapping.

  11. What's Next?0:35

    Java Quick Start Tutorial: You have the basics. Where to go next: beginner posts on Foojay.io, and free tutorials from the wider Java community.

3. Next Steps

You’ve now absorbed the basics of the Java programming language! Here are some of the next steps you can take with the knowledge you now have.

Learn more from on-line tutorials.

There are many more tutorials online, and we made a selection for you: free courses and catalogs from some of the best educators in the Java community.

6 free courses and catalogs

  • Foojay Java in Education Catalogby The Foojay community

    A community-driven catalog of Java learning resources: websites, tutorials, videos, books and tools for students, educators, coding clubs and developers. An open, collaborative hub for finding the best Java learning content for teaching, self-learning and classroom use — and contributions are welcome on GitHub.

  • JFX Central - Learn JavaFXby The JavaFX community

    JFX Central is the hub for everything JavaFX — libraries, tools, people, showcases and a cross-platform example app. Its Learn section gathers the tutorials, books, videos and courses for building desktop and mobile user interfaces in Java, once you have the language basics down.

  • Java Programmingby Angie Jones

    Angie Jones is an award-winning teacher and international keynote speaker who shares her wealth of knowledge at software companies and conferences worldwide. Her Java introduction course is excellent and free.

  • Java Tutorialby Jakob Jenkov

    Jakob Jenkov is a technopreneur, software architect, writer and publisher focused on the big ideas in the software and tech industry. He has published over 800 technical articles, which attract millions of readers every year. His tutorial site contains a lot of different sections, including a very extended one about Java.

  • Learn Java Basics with IntelliJ IDEAby Shai Almog

    Shai Almog is an author, DevRel, blogger, open source hacker, Java rockstar, conference speaker, instructor and entrepreneur. And he creates terrific video tutorials. In this series he teaches you to program with Java in the free IntelliJ IDEA community edition.

  • Introduction to Java Programmingby SJSU and Udacity

    Created by Cay Horstmann and Kathleen O'Brien of SJSU (San Jose State University) and Cheng-Han Lee and Sara Tansey of Udacity. Initially published on Udacity, it is now available for free on Cay's website. It is much more interactive than a typical video tutorial, following the principle of "if you talk for more than two minutes without an exercise, you've failed".

See also Other Tutorials.

Learn more on Foojay.io Today.

Here on Foojay.io you can find thousands of blog posts written by the community. The ones its authors marked as approachable are collected under Java Beginner.

Share this page

Found a mistake, or something to add? Edit this page on GitHub

Join the discussion