Courseiva
Java Platform Overview and PackagingmediumMultiple ChoiceObjective-mapped

1Z0-829 Java Platform Overview and Packaging Practice Question

A Java 17 application is packaged as a modular jar and deployed on a system with the full JDK. The application uses the java.sql module. The system administrator wants to minimize the footprint by creating a custom runtime image using jlink. Which command would create an image with only the necessary modules?

⚠ Common exam trap

Many candidates think `--bind-services` is required for modular applications or that explicitly listing `java.sql` is sufficient, but they overlook that the application module itself must be the root for proper dependency resolution.

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

jlink --module-path $JAVA_HOME/jmods:app --add-modules com.myapp --output myimage

`jlink` with `--add-modules com.myapp` and the module path pointing to both `$JAVA_HOME/jmods` and the application JAR automatically resolves all transitive dependencies, including `java.sql`, and creates a minimal runtime image containing only the required modules. The `--output myimage` specifies the target directory for the custom 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.

  • jlink --module-path $JAVA_HOME/jmods:app --add-modules com.myapp --output myimage

    Why this is correct

    This adds the application module and its transitive dependencies, including java.sql if required.

  • jlink --module-path $JAVA_HOME/jmods:app --add-modules com.myapp --bind-services --output myimage

    Why it's wrong here

    Adding --bind-services is not wrong but unnecessary for a basic modular app; still works but not minimal.

  • jlink --module-path $JAVA_HOME/jmods:app --add-modules java.sql --output myimage

    Why it's wrong here

    This only adds java.sql, not the applications module; the application wont run.

  • jlink --module-path $JAVA_HOME/jmods:app --add-modules ALL-MODULE-PATH --output myimage

    Why it's wrong here

    ALL-MODULE-PATH includes all modules on the path, making the image larger than necessary.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

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 →

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.