Getting started, you can use most any text editor. And obtain a Java Development Kit (JDK) from any of several vendors.
Later versions of Java added the convenience of not having to explicitly compile. You can simply run a
.java source file using
java your-file-name-here.java, and the compiler (
javac tool) will automatically be invoked, then your compiled
.class is executed (
JShell (a REPL)
Later versions of Java add the read–eval–print loop (REPL) facility. You can type one line at a time, incrementally being compiled and executed as you go.
This tool is known as JShell. Bundled with Java 9 and later. Defined in JEP 222: jshell: The Java Shell (Read-Eval-Print Loop).
JShell is good for learning and experimenting, but not for building a serious app.
BlueJ is an open-source free-of-cost IDE designed for students learning Java. This tool eliminates much of the overwhelming complexity of the commercial IDEs discussed below.
The three main popular integrated development environment (IDE) products are:
All of these run on Microsoft Windows as well as macOS, Linux, etc.
All of these are:
- Actively developed.
- Extremely powerful and very useful.
- Laden with bolted-on features, awkwardly designed, and come with a learning curve.
I’ve delivered software using each of them. Each has their own fanbase. NetBeans was quite useful to me when I was starting out. Nowadays I use IntelliJ, Ultimate Edition. Some folks swear by Eclipse, though I found it clunky in a designed-by-committee sort of way. You can be successful with any one of these three.
A fourth option is JDeveloper by Oracle, free-of-cost but proprietary (closed-source). I have not tried it, nor have I spoken with anyone using it. So I have no opinion.
You’ve not given enough criteria to make a further recommendation.
Build-automation & dependency-management
By the way, most of the IDEs support projects driven by Apache Maven, Apache Ivy, or Gradle, besides their own project-definition-and-build technology. These tools provide build-automation and dependency-management services.
Maven is most common. Eventually, you will likely want to put some time into learning the basics of Maven and its POM files.