Browse Oracle Certification Guides

1Z0-831 Java 25 JPMS, Packaging, and Launch Model Guide

Study 1Z0-831 Java 25 JPMS, Packaging, and Launch Model: key concepts, common traps, and exam decision cues.

This page needs exact reading, not fuzzy memory. For 1Z0-831, the stem is usually testing one of four things:

  1. Can one module read another module?
  2. Can one module access a package in another module?
  3. How does a service provider get discovered?
  4. Is the code using a normal launch model or a Java 25 preview launch feature?

One more framing point matters now: Java SE 26 is the current platform release, but this exam lane is still about Java 25 behavior. Keep stable JPMS rules separate from Java 25 preview features.

Start with the right question

If the stem is really about… First question to ask Main syntax or concept
module dependency Can module A read module B? requires
package exposure Even if A reads B, is the package exported? exports
service discovery Is the code using interface/provider lookup? uses and provides ... with ...
plain JAR on module path Is this a named module or just compatibility behavior? automatic module reasoning
compact source launch Is this preview launch behavior, not normal class packaging? compact source files and instance main
bulk import of exported packages Is the code using a preview import feature? module import declarations

Stable JPMS rules you should not blur together

requires is about readability. exports is about exposure. The exam often wins by separating those two ideas before you inspect anything else.

1// module com.example.app
2module com.example.app {
3    requires com.example.lib;
4}
5
6// module com.example.lib
7module com.example.lib {
8    exports com.example.lib.api;
9}

If com.example.app needs com.example.lib.api.Util, then both of these must be true:

  • com.example.app reads com.example.lib
  • com.example.lib exports com.example.lib.api

If either piece is missing, access fails for a different reason.

A fast exam distinction

Situation Likely problem
module name not readable missing or wrong requires
package exists but is not accessible package not exported
type is loaded dynamically through contract/provider wording service binding question
plain JAR on module path with no module-info.java automatic module behavior

Services are not just “modules plus interfaces”

Service questions usually test runtime composition. Do not reduce them to inheritance or imports.

 1// consumer module
 2module com.example.app {
 3    requires com.example.spi;
 4    uses com.example.spi.Formatter;
 5}
 6
 7// provider module
 8module com.example.provider {
 9    requires com.example.spi;
10    provides com.example.spi.Formatter
11        with com.example.provider.JsonFormatter;
12}

Strong reading:

  • uses belongs on the consuming side
  • provides ... with ... belongs on the provider side
  • the service type is the contract
  • the provider implementation is the concrete class discovered at runtime

Common exam mistake: choosing exports when the real question is provider discovery.

Automatic modules and compatibility questions

If the stem puts an ordinary JAR on the module path, you are often in automatic-module territory rather than fully designed JPMS territory.

Treat automatic modules as compatibility bridges:

  • they get a module name
  • they can read other modules broadly
  • they are not the same as a carefully authored module-info.java

The exam usually is not asking you to recite every automatic-module detail. It is usually asking whether you noticed that this is compatibility behavior, not a hand-designed named module.

Java 25 preview features in this lane

This is where stale Java 9-era thinking causes wrong answers. JPMS itself is old enough to be stable, but some launch-related language around this chapter is still preview in Java 25.

Module import declarations

Java 25 still treats module import declarations as a preview language feature.

Conceptually, they let you import packages exported by a module with one declaration instead of many type imports.

1import module java.base;
2
3public class Demo {
4    String value = java.util.Objects.requireNonNull("ok");
5}

Exam rule:

  • if the code uses module import declarations, preview rules matter
  • preview features require the right compile and run flags
  • do not treat them as permanent baseline syntax

Compact source files and instance main

Java 25 also keeps compact source files and instance main methods in preview.

1void main() {
2    System.out.println("Hello");
3}

That is not the same lane as normal class packaging or modular application assembly. If the stem shows a small source-launch example, do not drift into JPMS reasoning unless the question explicitly joins the two.

Preview compile/run mindset:

1javac --release 25 --enable-preview Demo.java
2java --enable-preview Demo

For source-file launch:

1java --enable-preview Demo.java

You do not need to memorize every launcher nuance. You do need to notice that preview status changes the command-line assumptions.

Decision order that usually wins

  1. Decide whether the stem is about modules, services, compatibility, or preview launch behavior.
  2. If it is JPMS, separate readability from exports before reading the answers.
  3. If the stem uses service vocabulary, shift to uses / provides.
  4. If the code is a plain JAR on module path, think automatic module before anything more advanced.
  5. If the code uses compact source files, instance main, or module import declarations, mark preview status immediately.

Common traps

Trap Better rule
treating requires like exposure requires is readability; exports is package visibility
assuming service lookup is just inheritance service binding is runtime composition
treating automatic modules like authored named modules compatibility behavior is the point
forgetting preview flags for preview syntax preview status changes compile and launch assumptions
dragging JPMS into every launch question compact source launch is a separate lane unless the stem connects them

What to remember under pressure

  • Readability is not the same as exposure.
  • uses and provides are service words, not general module words.
  • Automatic modules are compatibility shortcuts.
  • Java 25 preview features are not safe to treat as permanent baseline syntax.
  • If the question mixes modules and launch syntax, separate the stable JPMS rule from the preview launch rule first.

Quiz

Loading quiz…
Revised on Monday, June 15, 2026