Any text editor can be used to edit a Java program. Online development environments like
replit.com are very popular.
VSCode is a popular code editor that is available for Windows, Macs, and Linux systems. Popular Linux editors include
vim
and
emacs
, which are also available on macOS and Windows. Free macOS editors include
BBEdit and
TextEdit, which is also available for
Windows computers.
Notepad++ is also a popular Windows text editor. There are also
Integrated Development Environments (IDEs) that include an editor, compiler, and other tools, such as Eclipse, Netbeans, IntelliJ, jGrasp, etc.
The file name must exactly match the public class name. For example, if the file containing the
HelloWorld
class were named
helloworld.java
or
Helloworld.java
, that would cause an error. Java would be looking for a file named
HelloWorld.java
.