Courseiva
Question 103 of 513
Java Platform Overview and PackagingeasyMultiple ChoiceObjective-mapped

1Z0-829 Java Platform Overview and Packaging Practice Question

A Java developer is building a modular application that uses only the `java.base` and `java.sql` modules. The application runs correctly with a full JDK 17 installation. The developer wants to distribute a minimal runtime image to reduce download size for end users. They have the application module JAR file and all dependencies are modular. The developer runs the command `jlink --module-path $JAVA_HOME/jmods:app --add-modules app --output myimage` but receives an error: "Error: java.sql module not found". What is the most likely cause of this error?

⚠ Common exam trap

Many exam-takers assume `jlink` automatically includes all JDK modules present in the module path, but it only includes those explicitly requested or required by the specified root 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 `--add-modules` option was not specified for `java.sql`, so it is not included in the runtime image.

`jlink` only includes modules explicitly specified with `--add-modules` (plus their transitive dependencies) in the runtime image. The command only specifies `--add-modules app`, so `java.sql` is not included unless `app` requires it. Since the error says 'java.sql module not found', the most likely cause is that `java.sql` was not listed in `--add-modules` and is not a transitive dependency of `app`.

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 `--add-modules` option can only be used with root modules, but `java.sql` is not a root module.

    Why it's wrong here

    `--add-modules` can add any module, not just root modules.

  • The `java.sql` module is not a standard JDK module and must be compiled separately.

    Why it's wrong here

    `java.sql` is a standard module included in the JDK.

  • The module path is missing the application's output directory.

    Why it's wrong here

    The module path includes both $JAVA_HOME/jmods and the app directory, which should contain the module JAR.

  • The `--add-modules` option was not specified for `java.sql`, so it is not included in the runtime image.

    Why this is correct

    jlink only includes modules explicitly listed with `--add-modules` and their transitive dependencies. Since `java.sql` is not added, it is missing.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 25, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.