Courseiva
Java Platform Overview and PackagingeasyMultiple ChoiceObjective-mapped

1Z0-829 Java Platform Overview and Packaging Practice Question

A developer creates a Java application that uses the new 'jpackage' tool to create an installer for Windows. The application is modular and has a main class declared in module-info. Which option is required to specify the main class when using jpackage?

⚠ Common exam trap

Many candidates confuse `--module` with `--module-path` or `--main-jar`, mistakenly thinking the main class must be specified via a JAR or classpath even when the module system already declares it.

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

--module

For a modular application with a main class declared in module-info, jpackage requires the `--module` option to specify the module name and, optionally, the main class (e.g., `--module com.example/com.example.Main`). This is because jpackage uses the module system to resolve the entry point, not a classpath or JAR-based approach.

Answer analysis

Option-by-option breakdown

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

  • -classpath

    Why it's wrong here

    classpath is not used with jpackage; the tool uses module path.

  • --module-path

    Why it's wrong here

    --module-path specifies locations of modules, but does not identify the main class.

  • --main-jar

    Why it's wrong here

    --main-jar is used for non-modular applications packaged as a jar with a Main-Class attribute.

  • --module

    Why this is correct

    For modular applications, jpackage uses --module to specify the main module, and the application's main class is derived from the module descriptor.

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

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.