1Z0-819 · Question #127
Which of the following commands is necessary to create and run a custom runtime image from Java source files?
The correct answer is B. javac, jlink. Option B (javac, jlink) is correct because creating a custom runtime image from source requires two distinct steps: javac compiles .java source files into bytecode (.class files), and jlink then assembles a custom, optimized JRE image containing only the modules your…
Question
Options
- Ajavac, jdeps
- Bjavac, jlink
- Cjar, jlink
- Djavac, jar
How the community answered
(26 responses)- A4% (1)
- B73% (19)
- C15% (4)
- D8% (2)
Explanation
Option B (javac, jlink) is correct because creating a custom runtime image from source requires two distinct steps: javac compiles .java source files into bytecode (.class files), and jlink then assembles a custom, optimized JRE image containing only the modules your application needs.
Why the distractors are wrong:
- A (javac, jdeps):
jdepsis a dependency analysis tool - it tells you which modules your code uses, but it cannot produce a runnable runtime image. - C (jar, jlink):
jarpackages compiled classes into an archive, but it can't compile source files - you'd still needjavacfirst; skipping compilation means there's nothing to package or link. - D (javac, jar):
jarcreates a JAR archive, not a custom runtime image - it won't produce a self-contained JRE you can distribute without a full JDK installed.
Memory tip: Think of the pipeline as "compile → link" - javac is the compiler and jlink is the linker, mirroring the classic compile/link stages in languages like C. The "j" in jlink stands for Java linking a runtime image together.
Topics
Community Discussion
No community discussion yet for this question.