Courseiva
Java Platform Overview and PackaginghardMultiple ChoiceObjective-mapped

1Z0-829 Java Platform Overview and Packaging Practice Question

Network Topology
jlinkmodule-path /path/to/modulesadd-modules com.example.appoutput my-imagestrip-debugcompress=2

Refer to the exhibit. The resulting image directory includes a 'bin' directory with java launcher. When running the application, a NoClassDefFoundError occurs for a class from module com.example.lib. What is the most likely cause?

⚠ Common exam trap

Oracle often tests the distinction between missing classes due to module omission (NoClassDefFoundError) versus missing classes due to reflection (ClassNotFoundException), and candidates may confuse --strip-debug with removing class files.

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 com.example.lib module was not added via --add-modules.

When using jlink to create a custom runtime image, only the modules explicitly specified (or their transitive dependencies) are included. If the application depends on com.example.lib but it was not added via --add-modules, the module's classes will be missing from the image, causing a NoClassDefFoundError at runtime. This is the most direct cause among the options.

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 --compress=2 option altered the class.

    Why it's wrong here

    Compression does not alter class functionality; it compresses resources in the image.

  • The application uses reflection to access the class.

    Why it's wrong here

    Reflection would cause ClassNotFoundException, not NoClassDefFoundError at startup.

  • The com.example.lib module was not added via --add-modules.

    Why this is correct

    Only modules explicitly added (and their transitive dependencies) are included.

  • The --strip-debug option removed the class file.

    Why it's wrong here

    --strip-debug only removes debug information, not class files.

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 →

How Courseiva writes practice questions · Editorial policy

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.