Let's Get Started!
We're assuming that you're a beginner, so we'll make it as easy as possible to run your first Java code.
We'll show you the easy way first, and then we'll show you a trickier but more powerful way to run Java code using the command line.
Using an IDE
Integrated development environments (IDEs) are what most people use to write code, especially newcomers. They provide you with 99-100% of what you need to write and run code. They also provide a built-in console so that you can view the output of your program.
Here are some popular IDEs that many Java developers use. No matter the IDE, you will need to have Java Standard Edition Development Kit (may be referred to as Java SE or JDK). You can download the JDK here.
These are the most popular Java IDEs. All are free to use. We'll link some helpful "Getting Started" guides so that you can set up your Java development environment without any hassle. Remember, install the JDK first!
As a Java learner, we highly recommend installing Java 8 or Java 11.
Long story short, the latest versions are rare in industry. Java 8 and Java 11 are very popular in industry. Upgrading can be a hassle, and these versions provided a lot of awesome features that modern applications can still use.
Again, we recommend installing Java 8 or Java 11, so you can focus on "core" Java first. Then, once you have a solid grasp of what these versions entail, you can optionally learn features of newer versions.
IntelliJ Idea has been the top Java IDE for years, to nobody's surprise. It has extensive features, a friendly interface, and most importantly, it's easy to use. The only setup you will likely encounter is when your SDK path is incorrectly set. This guide should help you overcome this. We recommend this IDE as the best Java development tool.
Eclipse is another leader in the world of Java, and has been for a long time. Look at it this way: IntelliJ is newer to the game, but it's clear that they borrowed from Eclipse, and expanded. Eclipse still comes with powerful tools and an easy-to-use interface. Similar to IntelliJ, you will likely be required to configure your Eclipse settings, so that it knows where your JDK is installed. Here is a guide on configuring Java in Eclipse.
Visual Studio Code (often called VS Code) is easily one of the biggest IDEs that's not specific to Java. You can code in just about any language, with the help of a huge library of Extensions. Baeldung has a great beginner's guide on setting up Java in VS Code.
Netbeans used to be incredibly popular, but is now in the shadow of IntelliJ, Eclipse, and VS Code. Nevertheless, it's still a powerful IDE, and one that senior Java developers (10-15+ years) are very familiar with. It has great integration with Java Enterprise Edition (EE), so if you are building a Java EE app, Netbeans is often recommended.
Which IDE do you choose? Which is best? Everyone will give you different opinions, so it's not something we like to bicker on. Just choose one, and start learning to code. That's the important part. These are the general views we've seen on these IDEs.
- Use IntelliJ if you are primarily learning Java, and want to fully explore Java
- Use VS Code if you are learning multiple programming languages, want to keep things as simple as possible, and/or you aren't at the advanced stages of Java yet.
Running Java on the Command Line
Coming soon!