TextPad is a popular tool for developing Java programs because of its simplicity and speed. It’s ideal for learning Java because it doesn’t generate any code for you. Writing every line of code yourself may seem like a bother, but the exercise pays off in the long run because you have a better understanding of how Java works.
You can download a free evaluation version of TextPad from Helios Software Systems. You can use the evaluation version free of charge, but if you decide to keep the program, you must pay for it. (Helios accepts credit card payment online.)
If the Java JDK is already installed on your computer when you install TextPad, TextPad automatically configures itself to compile and run Java programs. If you install the JDK after you install TextPad, you need to configure TextPad for Java by following these steps:
- Choose Configure→Preferences to open the Preferences dialog box.
- Click Tools in the tree that appears on the left side of the dialog box.
- Click the Add button to reveal a drop-down list of options and then click Java SDK Commands.
The figure below shows how the Preferences dialog box appears when the Java tools are installed. As you can see, the Tools item in the tree on the left side of the dialog box includes three Java tools: Compile Java, Run Java Application, and Run Java Applet. (The Run Java Applet tool is obsolete, so you can safely ignore it.)Configuring tools in TextPad
- Click OK. The commands you need to compile and run Java programs are added to TextPad’s Tools menu.
If you plan on using any preview features in Java, add the --enable-preview
and --release 14
flags to the command line arguments for the Compile tool. The complete Compile tool arguments should look like this:
--enable-preview --release 14 $File
Then, add just the --enable-preview
flag to the Run Java Application arguments list; the complete arguments should look like this:
--enable-preview $BaseName
Do not add the --release
flag to the Run Java Application tool. If you do, the tool won’t be able to start the JVM, because --release
is not a valid flag for the java
command.