Sitemap
Thevintagecoder

Thevintagecoder

As a CS major, I'm voyaging through the vast, exhilarating world crafted by code. Tech, books, and photography are the key passions that color my journe

Stop Clicking “Run”: A Step-by-Step Guide to Learning Java the Real Way with Sublime Text and the Terminal

4 min readDec 10, 2025

--

Press enter or click to view image in full size

Introduction: The Power of the Fundamentals

We live in a “black box” world. We are used to pushing buttons, getting instant results, and simply moving on without ever knowing how things actually work. We see it everywhere — apps that handle everything for us and systems that hide the messy details underneath.

When you start learning how to code, especially in university, the temptation is to jump straight into a powerful Integrated Development Environment (IDE) like VS Code or IntelliJ. You press a green “Run” button, and magic happens. But relying on that magic is a dangerous habit. It leaves you with a “goldfish memory” of how software actually works; you execute commands without knowing why they work or, more importantly, why they fail.

We are going to refuse to just “move on” to the easy stuff. We are going to strip away the heavy tools and look at the system in its raw state. By using a simple text editor (Sublime Text) and the Command Line, you will force yourself to understand the compilation process. It might feel like a hassle now, but this is a permanent alteration of your skillset that will distinguish you from the average coder later.

The Java Process: Code to Command Line

Before we touch the keyboard, we need to understand the lifecycle of a Java program. It isn’t just “typing and running.” It’s a transformation. There is a reason why Java is called a “Legacy Language” and why it is widely used by tech companies till date. What if I tell you that Java has a interpreter that interprets and does the work for you for the code to run simultaneously in Windows, Mac and Linux? Here is the process of how it goes, I am still learning and writing this as a testimony to what I have learned till now.

  • Source Code (.java): This is what you write. It is human-readable. It looks like English mixed with some logic.
  • The Compiler (javac): This is the translator. The computer does not understand your source code. The compiler takes your code and translates it into a format called Bytecode.
  • Bytecode (.class): This is the crucial detail often missed by beginners. When you compile, a new file is created. This file (ending in .class) contains instructions that aren't for you, and aren't for the hardware directly—they are for the Java Virtual Machine.
  • The JVM (Java Virtual Machine): This is the engine that actually runs the program. It reads the bytecode and executes it on your computer.

If you use an IDE, all of this happens in a blur behind the scenes. Today, we are going to do it manually so you can see the contrast between the code you write and the bytecode the machine executes.

Step-by-Step Setup and Execution Guide

Let’s build this system from the ground up.

A. Installation

1. Install the JDK (Java Development Kit) : You need the tools to build.

  • Windows/Mac: Go to the official Oracle website or Adoptium and download the latest JDK (Java Development Kit). Run the installer. This installs both the Compiler (javac) and the Runtime (java).

2. Install Sublime Text: We want a lightweight editor that doesn’t hide anything from us.

Let me know if it does not work out in your end, would be happy to help!

B. The Command Line Workflow

  1. Create Your First Program: Open Sublime Text. We are going to write a classic “Hello World.”

Type this exactly:

public class MyProgram {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}

2. Save the File This part is non-negotiable. You must save the file with the exact same name as the class name.

  • Save it as: MyProgram.java
  • Save it somewhere easy to find, like a folder named JavaProjects on your Desktop.

3. Open the Terminal / Command Prompt This is the interface where you talk to the system directly.

  • Mac: Press Command + Space, type “Terminal,” and hit Enter.
  • Windows: Press the Start button, type “cmd,” and hit Enter.

4. Navigate to Your File Right now, the terminal is looking at your home folder. We need to move it to where you saved your file. We use the cd (change directory) command.

  • Mac: cd Desktop/JavaProjects
  • Windows: cd Desktop\JavaProjects (Note: If you saved it in Documents, replace Desktop with Documents).

5. Compile the Code (The Magic Step) Now, we summon the compiler. Type this command and hit Enter:

javac MyProgram.java
  • What just happened? If you typed everything correctly, the terminal will say absolutely nothing. It will just give you a new line. But if you look in your folder now, you will see a new file called MyProgram.class.
  • You have just turned your human ideas into machine bytecode!

6. Execute the Bytecode Now, we ask the Java Virtual Machine to run that .class file. Type this:

java MyProgram

(Note: Do NOT type .class or .java here. Just the name.)

  • The Result: You should see Hello, World! printed on your screen.

Conclusion: Your Superpower Unlocked

It is easy to feel like a commoner in the world of computer science, relying on tools you don’t understand to do work you can’t explain. But today, you looked under the hood.

By manually compiling (javac) and running (java) your code, you’ve proven that you don't need a heavy, complex interface to build software. You understand that code isn't magic—it's a process of translation.

Eventually, you will move on to VS Code or IntelliJ, and that’s fine. But you will do so with the confidence of someone who knows the foundations. You aren’t just scrolling through features anymore; you know how the system works. And in a dystopian tech landscape full of abstraction, understanding the “how” and “why” is the only control we really have.

--

--

Thevintagecoder
Thevintagecoder

Written by Thevintagecoder

As a CS major, I'm voyaging through the vast, exhilarating world crafted by code. Tech, books, and photography are the key passions that color my journe