Part 1
Chapter 1: The Sandbox Trap--–- You have just downloaded the JDK. Your IDE is open. You write System.out.println("Hello World"), click the green "Run" button, and the console prints your message. You feel good. You are ready for the certification exam.You are also completely unprepared for how Java really works in the real world.The green button lies to you. It hides the compilation process, conceals the classpath, and pretends that the chaotic mess of package directories and JAR dependencies doesn't exist. When you take the Oracle Certified Associate (OCA) or Oracle Certified Professional (OCP) exam, there is no green button. When you deploy your code to a Linux server in a data center, there is no IDE.
There is only the terminal, the compiler, and your own understanding of how Java transforms source code into running software.This chapter is called "The Sandbox Trap" because most developers learn Java in a sandboxed IDE environment that actively prevents them from understanding the very mechanics the certification exam tests and the enterprise job interview demands. You will learn to compile and run Java from the terminal—the same way every CI/CD pipeline, every Docker container, and every production server does it. By the end of this chapter, the green button will be a convenience, not a crutch.Why the Terminal Matters More Than Your IDEThe Java certification exams are not tests of your ability to navigate IntelliJ or Eclipse.
They are tests of the Java language itself—the compiler, the virtual machine, and the runtime environment. Oracle expects you to understand what happens between writing .java files and executing a program. This understanding begins with three concepts that IDEs hide from you:The compilation process – How javac transforms human-readable code into bytecode.The classpath – How the JVM finds the .class files it needs to run.The difference between a class and a file – Why your filename must match your public class name, and what happens when it doesn't.Every year, candidates fail the OCA exam because they cannot explain what the -d flag does in javac -d classes src/MyApp.java.