Question 324 of 509
Java Platform Overview and PackagingmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct answer is that the modularized JARs are being loaded from the classpath, so they become unnamed modules, and `--add-opens` does not apply to unnamed modules. This occurs because the classpath vs module path distinction is critical in JPMS: any JAR placed on the classpath—even one containing a module-info.class—is automatically treated as an unnamed module, stripping it of its modular identity. The `--add-opens` flag is a named-module-only mechanism; it can only open packages within named modules on the module path, not within unnamed modules on the classpath. On the Oracle Certified Professional Java SE 17 Developer 1Z0-829 exam, this scenario tests your understanding of how JPMS resolves modules and the strict boundary between named and unnamed modules. A common trap is assuming that adding `--add-opens` will fix reflection errors regardless of where the JAR is loaded, but the flag is simply ignored for unnamed modules. Memory tip: think of the classpath as the "wild west" where all JARs lose their module identity, so `--add-opens` cannot police them.

1Z0-829 Java Platform Overview and Packaging Practice Question

This 1Z0-829 practice question tests your understanding of java platform overview and packaging. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A team is migrating a large legacy application from Java 8 to Java 17. The application consists of multiple JAR files that are placed on the classpath. Some of these JAR files have been updated to include module-info.class files, making them named modules. After migration, the application throws `IllegalAccessError` for several deep reflection calls that used to work in Java 8. The team has added `--add-opens` JVM flags to open the required packages, but the error persists. The application also uses a third-party library that is not modularized and is placed on the classpath. The team notices that the `--add-opens` flags are being ignored for packages in the modularized JARs. What is the most likely reason?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "most likely"

    Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.

Question 1mediummultiple choice
Read the full NAT/PAT explanation →

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 modularized JARs are being loaded from the classpath, so they become unnamed modules, and `--add-opens` does not apply to unnamed modules.

Option C is correct because when a JAR file containing a module-info.class is placed on the classpath instead of the module path, it is treated as an unnamed module. The `--add-opens` JVM flag only applies to named modules (those on the module path) and has no effect on unnamed modules. Since the modularized JARs are loaded from the classpath, they become unnamed modules, and the `--add-opens` flags are ignored, causing the `IllegalAccessError` to persist.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

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-opens` flags are being overridden by other JVM flags.

    Why it's wrong here

    There is no indication of override; the flags are syntactically correct.

  • The application does not have a module-info.java file for its own code.

    Why it's wrong here

    Even without a module-info, the application can still use classpath. The issue is not about the application's modularization.

  • The modularized JARs are being loaded from the classpath, so they become unnamed modules, and `--add-opens` does not apply to unnamed modules.

    Why this is correct

    `--add-opens` only applies to named modules. JARs on the classpath, even if they have module-info, are treated as unnamed modules if placed on the classpath. They must be on the module path to be named modules.

    Clue confirmation

    The clue word "most likely" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

  • The classpath is deprecated and ignored in Java 17, so all JARs are treated as modules.

    Why it's wrong here

    The classpath is still supported in Java 17. JARs on the classpath without module-info become part of the unnamed module.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Oracle often tests the misconception that placing a modularized JAR on the classpath still makes it a named module, leading candidates to overlook the critical distinction between classpath (unnamed module) and module path (named module) in Java 9+.

Detailed technical explanation

How to think about this question

In the Java module system, `--add-opens` is defined in the JVM specification to open packages of named modules for deep reflection. When a JAR is placed on the classpath, it becomes part of the unnamed module, which cannot be targeted by `--add-opens` because the flag requires a module name. This is a common migration pitfall: teams assume that adding module-info.class to a JAR automatically makes it a named module, but the JAR must be on the module path (via `--module-path`) for that to happen. In real-world scenarios, mixing classpath and module path can lead to subtle access control issues.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related 1Z0-829 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free 1Z0-829 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this 1Z0-829 question test?

Java Platform Overview and Packaging — This question tests Java Platform Overview and Packaging — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: The modularized JARs are being loaded from the classpath, so they become unnamed modules, and `--add-opens` does not apply to unnamed modules. — Option C is correct because when a JAR file containing a module-info.class is placed on the classpath instead of the module path, it is treated as an unnamed module. The `--add-opens` JVM flag only applies to named modules (those on the module path) and has no effect on unnamed modules. Since the modularized JARs are loaded from the classpath, they become unnamed modules, and the `--add-opens` flags are ignored, causing the `IllegalAccessError` to persist.

What should I do if I get this 1Z0-829 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

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 30, 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.