1Z0-829 Java Platform Overview and Packaging Practice Question
A developer wants to include a module in a custom runtime image using jlink. The module's `module-info.java` does not explicitly export any packages. When running the application from the custom image, a ClassNotFoundException is thrown for a class from that module. What is the most likely cause?
⚠ Common exam trap
Candidates often assume including a module in the jlink command is sufficient to make all its classes accessible, but the Java module system enforces encapsulation at the package level, so without explicit `exports`, the classes are invisible to other modules.
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
✓
The module's packages are not exported, making them invisible to other modules.
If a module's `module-info.java` does not explicitly export any packages, those packages are not accessible to other modules at runtime. Even if the module is included in the custom runtime image via jlink, the `ClassNotFoundException` occurs because the class is not exported, making it invisible to other modules. The `jlink` tool includes the module's classes in the image, but without an `exports` directive, the packages remain encapsulated.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The application does not require the module.
Why it's wrong here
If it didn't, the module wouldn't be resolved at all.
- ✓
The module's packages are not exported, making them invisible to other modules.
Why this is correct
Unexported packages are not accessible, causing ClassNotFoundException.
- ✗
The module uses an automatic module that is not present.
Why it's wrong here
Not relevant to the exported packages issue.
- ✗
The module was not included in the jlink command.
Why it's wrong here
If not included, the module would be missing entirely.
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 →
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.