1Z0-829 Java Platform Overview and Packaging Practice Question
A development team is working on a Java 17 application that must be packaged as a custom runtime image for deployment on a Linux server without a JDK installed. The application uses `java.base`, `java.logging`, and `java.sql` modules, and also requires the `jdk.crypto.cryptoki` module for hardware security module (HSM) integration. The team wants to minimize the image size while ensuring all necessary modules are included. They run `jlink --add-modules java.base,java.logging,java.sql,jdk.crypto.cryptoki --output myapp-runtime`. The resulting image runs the application but fails at startup with a `ClassNotFoundException` for `javax.crypto.spec.SecretKeySpec`. Which action should the team take to resolve the issue?
⚠ Common exam trap
Candidates often assume adding the module name to `--add-modules` is sufficient, but they overlook that `jlink` requires `--bind-services` to include service provider modules that are discovered via the service loader mechanism.
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
✓
Add `--bind-services` to the jlink command to include service provider modules.
The `jdk.crypto.cryptoki` module is a service provider module that provides cryptographic services via the Java Cryptography Architecture (JCA). When using `jlink`, service provider modules are not automatically included unless `--bind-services` is specified, because `jlink` only includes modules directly referenced in the module graph. The `javax.crypto.spec.SecretKeySpec` class is part of `java.base`, but the actual provider implementation that makes it available at runtime is in `jdk.crypto.cryptoki`; without `--bind-services`, the service linkage is missing, causing the `ClassNotFoundException`.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Manually add the `java.security.jgss` module to the `--add-modules` list.
Why it's wrong here
Incorrect: SecretKeySpec is in java.base; adding jgss is not the direct fix.
- ✗
Use the `--list-modules` option with jlink to verify which modules are included, then add any missing ones.
Why it's wrong here
Incorrect: This is a diagnostic step but not the action that resolves the issue; the team needs to include the missing services.
- ✗
Add `ALL-MODULE-PATH` to the `--add-modules` list to include all available modules.
Why it's wrong here
Incorrect: This would include all modules, defeating the purpose of minimizing image size.
- ✓
Add `--bind-services` to the jlink command to include service provider modules.
Why this is correct
Correct: --bind-services links service provider modules required by the specified modules, which may include necessary crypto implementations.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every 1Z0-829 question from scratch — 513 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.