Three things need to exist on the machine before the first line of Java: a JDK, a terminal that can run it, and a folder where your code lives. Get those right once and the rest of the setup becomes preference. Get them wrong and every tutorial you follow will fail at step one in a way that looks like your fault.
One JDK, installed deliberately
Install a current long-term-support JDK and let it put itself on the system path. Then open a fresh terminal and check two commands: java -version and javac -version. If both answer with the same version, you are done and can ignore every other Java installation on the machine.
If they disagree, or one is missing, fix that before anything else. Two JDKs on one machine is a reliable source of confusing errors, and uninstalling the old one is usually faster than trying to manage both.
Pick an editor and stop shopping
Any of the mainstream Java IDEs will do more than a beginner needs. The choice matters far less than the decision to stop comparing them. Pick one, learn four things, and move on: how to create a project, how to run the current file, how to format code, and where the build output goes.
Whichever you choose, keep the terminal in your workflow. Compile and run a file by hand at least once, so that the button in the IDE is something you understand rather than something you trust. That knowledge pays off the first time a build tool disagrees with you.
Set up a folder that scales with you
Make a single directory for your Java work, and inside it one folder per project. Not one folder per file, and not everything on the desktop. A structure that survives a year looks roughly like this:
java-work/at the top, outside any synced or temporary directory.- Inside it, one directory per project, named for the project rather than the date.
- Inside each project, a
srcfolder for source files and anotes.mdfor what you were trying to do. - A
scratchdirectory for throwaway experiments you will delete later.
The notes file is the part people skip and later wish they had. One line explaining the intent saves ten minutes of reading your own code back.
Version control from the first commit
Install Git and create a repository in the workspace directory on day one, before there is anything worth saving. The first commit can be an empty file. What matters is the habit of committing when something works, so that you always have a version you can return to when an experiment goes wrong.
Add a .gitignore for compiled output and IDE settings, then commit once per working session. Learning to undo a change safely is a bigger confidence boost than any tutorial.
Build the physical setup for focus
A second monitor is genuinely useful for code plus documentation, but a single laptop and a pair of headphones will do. What matters more is that the desk is set up for long sessions: screen at eye level, a real keyboard, water within reach. A workspace that hurts to sit at is a workspace that gets abandoned.
Finally, keep one obvious place to start each day. A shortcut to the editor and the project folder open in a file browser removes just enough friction to make the difference between a session and a scroll.