Skip to content

What a development machine needs

Practical 5.9 what-a-development-machine-needs-annex.pdf · PDF

An Android app runs happily on a phone with a few GB of RAM. For the computer where that same app is built, Google recommends 32 GB. Why does making an app cost so much more than using it?

Until today you looked after machines for other people. From today the customer is you: next year you will write apps. The question is simple: is this machine good enough, and how do you prove it? "It is a good computer" means nothing until you say: good for what?

What you will learn

  • Tell apart the tools a developer installs: compiler, runtime, SDK, IDE and emulator
  • Read the official requirements of a tool and separate minimum from recommended
  • Measure a machine with commands (cores, RAM, disk, virtualisation, C library) and compare it with those requirements
  • Install a Java toolchain in deb-lab, find where it lives and explain why the shell finds it
  • Compile and run your first Java program from the terminal
  • Why "minimum requirements" does not mean "it will work fine"

The test kitchen

Since Unit 1 our kitchen has served dishes: the CPU is the chef, RAM the countertop, the disk the pantry. A development machine is a test kitchen: recipes are written, tried, thrown away and tried again. It needs everything a normal kitchen has, plus the tools to invent.

Tool What it is In the test kitchen
Source code The program as text that a person writes The recipe on paper
Compiler / interpreter Turns source code into something the machine can run The cook who turns the recipe into a dish
Runtime What must be on a machine for the finished program to run (for Java: the JVM) The oven: without it the dish cannot be served anywhere
SDK Software Development Kit: compiler, libraries and tools for one platform (the JDK for Java, the Android SDK) The full toolbox for one cuisine
IDE Integrated Development Environment: editor, build button and debugger in one program The workbench where everything is at hand
Emulator A whole pretend device running inside your computer A copy of the customer's kitchen built on your countertop

Careful: JDK and JRE are not the same

The JRE (Java Runtime Environment) only runs Java programs. The JDK (Java Development Kit) adds the compiler and the tools to make them. A user needs the runtime; a developer needs the kit. And by the way: Java and JavaScript are two different languages. Only the name is similar.

Reading the bill: official requirements

Every tool says what it needs on its vendor's page. These are the numbers from Microsoft, JetBrains and Google, read in October 2026 (they change: always check the current page).

Requirement VS Code IntelliJ IDEA Android Studio Android Studio + emulator
RAM 1 GB 8 GB (3 GB free for the IDE) 8 GB 16 GB · recommended 32 GB
CPU 1.6 GHz or faster 4 cores VT-x / AMD-V, newer than 2017 The same
Free disk Under 500 MB 10 GB 8 GB 16 GB · recommended SSD, 32 GB
Screen — 1280 × 720 1280 × 800 Recommended 1920 × 1080
Linux C library glibc 2.28+ glibc 2.28+ glibc 2.31+ glibc 2.31+

Two words in that table need a definition:

  • VT-x (Intel) and AMD-V (AMD) are the CPU features for hardware virtualisation, the same ones that let your PC run deb-lab at near full speed (Unit 2).
  • glibc is the GNU C library: the basic library almost every Linux program uses to talk to the kernel. A tool built for a newer glibc will not start on an older system.

Minimum means it starts, not it works well

Google's own text says the minimum covers small projects and one virtual device. Recommended is what a full working day needs. When you choose a machine for someone, read the recommended column.

Why the emulator is so expensive

An emulator is not just another app: it is a virtual machine running a full Android system with its own RAM. Google's figure is about 4 GB of memory for each virtual device that is running. And, like any VM, it needs VT-x or AMD-V. That is the answer to the hook: building the app means running the phone inside your computer, next to the IDE.

flowchart TB
    subgraph PC ["Your development PC: the RAM bill"]
        OS["<b>Operating system</b><br>the kitchen manager"]
        IDE["<b>IDE</b><br>Android Studio: the workbench"]
        EMU["<b>Emulator</b><br>a whole phone: ~4 GB each"]
        BUILD["<b>Compiler and build tools</b><br>the cooks, at full speed"]
    end
    OS --- IDE
    IDE -->|"builds the app"| BUILD
    BUILD -->|"installs it on"| EMU

Measure the machine

Before you compare, measure. Five commands, run in deb-lab and then in a terminal on the Ubuntu host:

nproc                                # processor threads
free -h                              # line Mem, column total: the RAM
df -h /                              # column Avail: free disk
ldd --version | head -1              # glibc version
grep -Ec '(vmx|svm)' /proc/cpuinfo   # 0 = no hardware virtualisation
Measure deb-lab Ubuntu host
nproc 2 The real number of threads
free -h (total) About 3.8 Gi (4 GB given to the VM) Depends on the PC
df -h / (Avail) About 15–18 G of 25 Depends on the PC
ldd --version ldd (Debian GLIBC 2.41-...) 2.41 A recent glibc, above 2.31
vmx\|svm count 0, unless nested virtualisation is on More than 0: one per thread

The last command counts the lines of /proc/cpuinfo that mention vmx (Intel's VT-x flag) or svm (AMD-V). Any number above 0 means "yes". On the host you will see a number like 8 or 12, one per thread.

Careful: 3.8 Gi of 4 GB is not enough for 4 GB

The question is not whether the VM has 4 GB. The question is whether it reaches the 8 GB of the IDE, and the OS already uses part of what is there. Verdict for deb-lab: VS Code yes; IntelliJ and Android Studio no, because 4 GB < 8 GB.

Your VM is a perfectly good server and a bad Android workstation. Good for what?

Runtimes: write once, run anywhere

In 1995 Sun Microsystems presented Java with a promise: write once, run anywhere. The trick: the Java compiler does not produce a program for one kind of CPU. It produces bytecode for an imaginary machine, the Java Virtual Machine (JVM). Any real computer with a JVM can run it. The price: the JVM, the runtime, has to be installed first. Kotlin, the language you will use for Android, is built on the same idea.

flowchart LR
    SRC["<b>Hello.java</b><br>source code: the recipe"] -->|"javac<br>compiler, in the JDK"| BC["<b>Hello.class</b><br>bytecode"]
    BC -->|"java<br>the JVM, the runtime"| RUN["<b>The program runs</b><br>on Linux, Windows, macOS"]

Versions and LTS

A new Java version comes out every six months. Some are LTS (Long-Term Support): companies stay on them for years. Today 21 (2023) and 25 (September 2025) are LTS. Debian 13 installs OpenJDK 21 by default.

Careful: the newest version is not always the right one

The right version is the one the project asks for. The wrong one gives errors that look like bugs in your code. Teams prefer LTS versions.

Install a toolchain in deb-lab

A toolchain is the set of tools you need to build a program: here, the JDK and Git.

$ java -version
bash: java: command not found
$ sudo apt update
$ sudo apt install default-jdk-headless git

Before you press Y, read the line "After this operation, ... of additional disk space will be used." On a minimal Debian the download is about 136 MB and it takes 341 MB on disk. Then check the three tools:

java -version      # openjdk version "21.0.x"
javac -version     # javac 21.0.x
git --version      # git version 2.47.3

Where does it live?

After apt install, why does java just work? The answer is PATH, the list of directories the shell searches when you type a command (you set it in Configuring the system by command).

$ which java
/usr/bin/java
$ readlink -f /usr/bin/java
/usr/lib/jvm/java-21-openjdk-amd64/bin/java

/usr/bin is in PATH, and /usr/bin/java is a symbolic link: a signpost that points to the real JDK in /usr/lib/jvm. With two JDKs installed, the signpost decides which one answers.

Many tools do not use PATH for this: they read the environment variable JAVA_HOME, which tells them where the JDK is. It is empty until somebody sets it. You, in ~/.bashrc:

echo 'export JAVA_HOME=/usr/lib/jvm/default-java' >> ~/.bashrc
source ~/.bashrc
echo $JAVA_HOME
$JAVA_HOME/bin/java -version     # the same version as before

“I installed Java from a zip in Downloads and it says command not found”

The files are there; their directory is not in PATH. The shell only looks where PATH tells it to. Same problem as any script outside PATH, same cure.

Your first Java program

mkdir ~/hello-java
cd ~/hello-java
nano Hello.java

Type exactly:

public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello from Java " + System.getProperty("java.version")
            + " on " + System.getProperty("os.name"));
    }
}
$ javac Hello.java
$ ls
Hello.class  Hello.java
$ java Hello
Hello from Java 21.0.x on Linux

javac prints nothing when it works: silence is success. It creates Hello.class, the bytecode. Then java runs it on the JVM.

Mistake What happens Fix
File called hello.java, class called Hello javac complains The file name must match the class name exactly
java Hello.class Error: it wants the class, not the file java Hello, no extension
A missing ; javac prints an error with a line number Read the line number, go there

Finally, run df -h / again: the toolchain cost a few hundred MB of disk, close to what apt announced.

Sizing the laptop for a new developer

Tramuntana Apps hires an Android developer. Which laptop do you ask for? Every line must be argued with a number from the requirements table.

Minimum that works Comfortable
RAM 16 GB (Android Studio + emulator) 32 GB (Google's recommendation)
CPU VT-x or AMD-V; newer than 2017 (Intel 8th gen Core i5 / AMD Ryzen) A recent Core i5/i7/i9 or Ryzen 5/7/9; Google advises against Intel N and U series
Disk 16 GB free for the tools, on an SSD SSD with 32 GB or more free; up to 6 GB more per extra virtual device
Screen 1280 × 800 1920 × 1080

If the budget only allows one upgrade, RAM or CPU? RAM: below 16 GB the emulator does not fit at all.

Careful: a gaming PC is not automatically a development PC

It is often good, but for other reasons. Development wants RAM and cores first; the graphics card matters little.

Now do it all yourself, measure, install, compile and decide, on the Practical 5.9 sheet (button at the top of the page).

Key takeaways

  • A developer's toolchain has a compiler (source code to something runnable), a runtime (needed to run it, like the JVM), an SDK (the full kit, like the JDK), an IDE (the workbench) and often an emulator (a whole device as a VM).
  • Requirements come in minimum (it starts) and recommended (it works for a day). Read the recommended one.
  • The Android emulator is a virtual machine: about 4 GB of RAM per running device, and it needs VT-x / AMD-V.
  • Measure before you decide: nproc, free -h, df -h /, ldd --version, grep -Ec '(vmx|svm)' /proc/cpuinfo.
  • java is found because /usr/bin is in PATH and /usr/bin/java is a symbolic link to the JDK; many tools read JAVA_HOME instead.
  • Java (1995) compiles to bytecode with javac and runs it on the JVM with java. Pick the version the project asks for, usually an LTS.

Quick check

1. Which tool turns Hello.java into Hello.class?
  • javac
  • java
  • git
  • apt

javac is the Java compiler, part of the JDK: it turns source code into bytecode (Hello.class). java is the runtime that then runs that bytecode on the JVM.

2. What is a JDK?
  • The compiler, runtime and tools needed to develop in Java
  • The editor where you write and debug Java code
  • A virtual Android phone that runs inside your PC
  • A Linux distribution made for Java developers

The JDK (Java Development Kit) is the SDK for Java: the compiler, the runtime and the tools. The JRE only runs programs; the JDK also makes them.

3. What is Google's minimum RAM for Android Studio with the emulator?
  • 16 GB
  • 8 GB
  • 4 GB
  • 2 GB

Android Studio alone asks for 8 GB; with the emulator, 16 GB, and Google recommends 32 GB. Each running virtual device takes about 4 GB more.

4. Why does the Android emulator need VT-x or AMD-V?
  • It is a virtual machine running a whole Android system
  • It draws the 3D graphics of the games you test
  • It compiles the Java and Kotlin code of the app
  • It needs to connect to Google's servers to start

An emulator is a pretend device: a full virtual machine. Like deb-lab, it needs the CPU's hardware virtualisation (VT-x on Intel, AMD-V on AMD) to run at a usable speed.

5. What is JAVA_HOME?
  • An environment variable that tells tools where the JDK is
  • The folder where you keep your own Java source files
  • The command that installs Java from the repository
  • The Debian package that contains the Java runtime

JAVA_HOME is an environment variable. Many build tools read it, instead of PATH, to find the JDK. It is empty until you set it, for example in ~/.bashrc.

6. You type java after installing it with apt and it works. Why does the shell find it?
  • /usr/bin is in PATH, and /usr/bin/java links to the real JDK
  • apt copies the whole JDK into your home directory
  • The shell searches the whole disk for a program called java
  • JAVA_HOME is set automatically by the installation

The shell only searches the directories of PATH. /usr/bin is one of them, and /usr/bin/java is a symbolic link to /usr/lib/jvm/.../bin/java. JAVA_HOME stays empty until you set it.

7. deb-lab shows nproc 2, free -h total 3.8Gi and a vmx|svm count of 0. Select the two that are true.
  • It can run VS Code, which asks for 1 GB of RAM
  • It cannot run Android Studio, which asks for 8 GB of RAM
  • It can run the Android emulator, because it has two threads
  • It meets the minimum for IntelliJ IDEA, because it is a VM

Compare each number with the requirements: 3.8 Gi is above VS Code's 1 GB but below the 8 GB of Android Studio and IntelliJ. A count of 0 for vmx|svm means no hardware virtualisation, so no emulator either. Good for what? A server, not an Android workstation.

Next: two projects that need two different versions of the same library on one machine — Dependencies and isolated environments.