Courseiva
Java Platform Overview and PackagingmediumMultiple ChoiceObjective-mapped

1Z0-829 Java Platform Overview and Packaging Practice Question

You are a Java developer at a logistics company. Your team is maintaining a legacy Java 8 application that uses dozens of jars on the classpath. The company has decided to migrate to Java 17 and adopt the module system. As a first step, you are analyzing the application's dependencies using jdeps. You run 'jdeps -s -dotoutput /tmp/deps' on all jars. The output shows many dependencies labeled 'not found' for internal packages that belong to other jars in the application. The packages are correctly exported by the respective jars (which are on the classpath). You suspect that because the jars are on the classpath, jdeps cannot resolve inter-jar dependencies as modules. To get accurate dependency information, what should you do?

⚠ Common exam trap

Watch out — candidates often think the --module-path option can be used while keeping jars on the classpath, but jdeps only performs module-aware analysis when all relevant jars are on the module path and none are on the classpath.

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

Place all the jars on the module path and remove them from the classpath when running jdeps.

When jars are on the classpath, jdeps treats them as unnamed modules and cannot resolve inter-jar dependencies as module-level relationships, leading to 'not found' labels. Placing all jars on the module path (Option B) forces jdeps to treat each jar as a module (if it has a module-info.class) or as an automatic module (if it does not), enabling accurate dependency resolution. This is the correct approach because the module path is designed for module-aware analysis, while the classpath is a legacy flat namespace.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use jlink to create a custom runtime image that includes all the jars.

    Why it's wrong here

    jlink does not analyze dependencies; it creates an image. Also, you should first understand dependencies.

  • Place all the jars on the module path and remove them from the classpath when running jdeps.

    Why this is correct

    This makes them automatic modules, allowing jdeps to resolve inter-jar dependencies as module dependencies.

  • Run jdeps with the --module-path option pointing to the directory containing all jars, and keep the jars on the classpath.

    Why it's wrong here

    Jars on classpath still are not treated as modules even if given on module path; you must put them on module path.

  • Convert each jar into a named module by adding module-info.java to each jar and recompiling.

    Why it's wrong here

    Converting every jar into a real named module means adding a module-info.java with correctly declared requires/exports to each of the dozens of jars, and recompiling all of them — a code change across the whole dependency graph. Moving the same unmodified jars onto the module path turns them into automatic modules (named from the jar/manifest, zero code changes) — enough for jdeps to resolve them as modules without touching a single jar's contents.

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.