jlink --strip-debug: Remove Debug Info from Custom Runtime Image
A company uses jlink to create a custom runtime image. They want to reduce the image size by removing debug information. Which jlink option or plugin should they use?
Quick Answer
The answer is the `--strip-debug` option. This jlink flag directly removes debugging metadata—such as line numbers, local variable tables, and source file references—from the custom runtime image, which is the most effective way to reduce image size when debug information is not needed. On the Oracle Certified Professional Java SE 17 Developer 1Z0-829 exam, this question tests your understanding of jlink’s modular image optimization features; a common trap is confusing `--strip-debug` with the `--compress` option, which handles different types of compression. Remember that `--strip-debug` specifically targets debugging artifacts, not class files or resources. A helpful memory tip: think of “strip” as peeling away debug layers to leave a leaner runtime, just like stripping unnecessary weight from a backpack.
⚠ Common exam trap
A common mix-up: candidates confuse `--strip-debug` with `--compress=2`, assuming compression removes debug information, but compression only reduces file size without eliminating the underlying debug metadata.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
--strip-debug
The `--strip-debug` option in jlink removes debug information from the custom runtime image, including line numbers, local variable tables, and source file references, which significantly reduces the image size. This is the correct option for stripping debug information, as it directly targets the removal of debugging metadata from the generated image.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
--compress=2
Why it's wrong here
Compresses resources but does not remove debug info.
- ✓
--strip-debug
Why this is correct
Specifically removes debug information to reduce image size.
- ✗
--no-header-files
Why it's wrong here
Removes header files, not debug info.
- ✗
--bind-services
Why it's wrong here
Binds service provider classes, unrelated to debug info.
Go deeper
Related to this question
About these practice questions
One of 513 original 1Z0-829 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on 1Z0-829
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Which command creates a custom runtime image containing only the modules needed by an application, reducing the size of the JRE?
easy- A.jmod
- B.jar
- ✓ C.jlink
- D.jdeps
Why C: The `jlink` tool is specifically designed to create a custom runtime image that contains only the modules required by a given application, along with their transitive dependencies. This reduces the JRE size by eliminating unused modules, which is a key feature of Java's module system (Project Jigsaw). Option C is correct because `jlink` is the only command among the choices that performs this modular runtime image assembly.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.