1 /*
  2  * Copyright (c) 2014, 2026, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.  Oracle designates this
  8  * particular file as subject to the "Classpath" exception as provided
  9  * by Oracle in the LICENSE file that accompanied this code.
 10  *
 11  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  * version 2 for more details (a copy is included in the LICENSE file that
 15  * accompanied this code).
 16  *
 17  * You should have received a copy of the GNU General Public License version
 18  * 2 along with this work; if not, write to the Free Software Foundation,
 19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  * or visit www.oracle.com if you need additional information or have any
 23  * questions.
 24  */
 25 
 26 /**
 27  * Defines the foundational APIs of the Java SE Platform.
 28  *
 29  * <dl class="notes">
 30  * <dt>Providers:</dt>
 31  * <dd> The JDK implementation of this module provides an implementation of
 32  *      the {@index jrt jrt} {@linkplain java.nio.file.spi.FileSystemProvider
 33  *      file system provider} to enumerate and read the class and resource
 34  *      files in a run-time image.
 35  *      The jrt file system can be created by calling
 36  *      {@link java.nio.file.FileSystems#getFileSystem
 37  *      FileSystems.getFileSystem(URI.create("jrt:/"))}.
 38  *      </dd>
 39  * </dl>
 40  *
 41  * @toolGuide java java launcher
 42  * @toolGuide keytool
 43  *
 44  * @provides java.nio.file.spi.FileSystemProvider
 45  *
 46  * @uses java.lang.System.LoggerFinder
 47  * @uses java.net.ContentHandlerFactory
 48  * @uses java.net.spi.URLStreamHandlerProvider
 49  * @uses java.nio.channels.spi.AsynchronousChannelProvider
 50  * @uses java.nio.channels.spi.SelectorProvider
 51  * @uses java.nio.charset.spi.CharsetProvider
 52  * @uses java.nio.file.spi.FileSystemProvider
 53  * @uses java.nio.file.spi.FileTypeDetector
 54  * @uses java.security.Provider
 55  * @uses java.text.spi.BreakIteratorProvider
 56  * @uses java.text.spi.CollatorProvider
 57  * @uses java.text.spi.DateFormatProvider
 58  * @uses java.text.spi.DateFormatSymbolsProvider
 59  * @uses java.text.spi.DecimalFormatSymbolsProvider
 60  * @uses java.text.spi.NumberFormatProvider
 61  * @uses java.time.chrono.AbstractChronology
 62  * @uses java.time.chrono.Chronology
 63  * @uses java.time.zone.ZoneRulesProvider
 64  * @uses java.util.spi.CalendarDataProvider
 65  * @uses java.util.spi.CalendarNameProvider
 66  * @uses java.util.spi.CurrencyNameProvider
 67  * @uses java.util.spi.LocaleNameProvider
 68  * @uses java.util.spi.ResourceBundleControlProvider
 69  * @uses java.util.spi.ResourceBundleProvider
 70  * @uses java.util.spi.TimeZoneNameProvider
 71  * @uses java.util.spi.ToolProvider
 72  * @uses javax.security.auth.spi.LoginModule
 73  *
 74  * @moduleGraph
 75  * @since 9
 76  */
 77 module java.base {
 78 
 79     exports java.io;
 80     exports java.lang;
 81     exports java.lang.annotation;
 82     exports java.lang.classfile;
 83     exports java.lang.classfile.attribute;
 84     exports java.lang.classfile.constantpool;
 85     exports java.lang.classfile.instruction;
 86     exports java.lang.constant;
 87     exports java.lang.foreign;
 88     exports java.lang.invoke;
 89     exports java.lang.module;
 90     exports java.lang.ref;
 91     exports java.lang.reflect;
 92     exports java.lang.runtime;
 93     exports java.math;
 94     exports java.net;
 95     exports java.net.spi;
 96     exports java.nio;
 97     exports java.nio.channels;
 98     exports java.nio.channels.spi;
 99     exports java.nio.charset;
100     exports java.nio.charset.spi;
101     exports java.nio.file;
102     exports java.nio.file.attribute;
103     exports java.nio.file.spi;
104     exports java.security;
105     exports java.security.cert;
106     exports java.security.interfaces;
107     exports java.security.spec;
108     exports java.text;
109     exports java.text.spi;
110     exports java.time;
111     exports java.time.chrono;
112     exports java.time.format;
113     exports java.time.temporal;
114     exports java.time.zone;
115     exports java.util;
116     exports java.util.concurrent;
117     exports java.util.concurrent.atomic;
118     exports java.util.concurrent.locks;
119     exports java.util.function;
120     exports java.util.jar;
121     exports java.util.random;
122     exports java.util.regex;
123     exports java.util.spi;
124     exports java.util.stream;
125     exports java.util.zip;
126     exports javax.crypto;
127     exports javax.crypto.interfaces;
128     exports javax.crypto.spec;
129     exports javax.net;
130     exports javax.net.ssl;
131     exports javax.security.auth;
132     exports javax.security.auth.callback;
133     exports javax.security.auth.login;
134     exports javax.security.auth.spi;
135     exports javax.security.auth.x500;
136     exports javax.security.cert;
137 
138     // additional qualified exports may be inserted at build time
139     // see make/gensrc/GenModuleInfo.gmk
140 
141     exports com.sun.crypto.provider to
142         jdk.crypto.cryptoki;
143     exports sun.invoke.util to
144         jdk.compiler;
145     exports com.sun.security.ntlm to
146         java.security.sasl;
147     exports jdk.internal to
148         jdk.incubator.vector;
149     // Note: all modules in the exported list participate in preview features,
150     // normal or reflective.  They do not need to be compiled with "--enable-preview"
151     // to use preview features and do not need to suppress "preview" warnings.
152     // It is recommended for any modules that do participate that their
153     // module declaration be annotated with jdk.internal.javac.ParticipatesInPreview.
154     exports jdk.internal.javac to
155         java.compiler,
156         jdk.compiler,
157         jdk.jdeps; // Uses Valhalla reflective preview APIs
158     exports jdk.internal.access to
159         java.desktop,
160         java.logging,
161         java.management,
162         java.rmi,
163         jdk.charsets,
164         jdk.jartool,
165         jdk.jlink,
166         jdk.jfr,
167         jdk.management,
168         jdk.net,
169         jdk.sctp,
170         jdk.crypto.cryptoki;
171     exports jdk.internal.classfile.components to
172         jdk.jfr;
173     exports jdk.internal.foreign to
174         jdk.incubator.vector;
175     exports jdk.internal.event to
176         jdk.jfr;
177     exports jdk.internal.io to
178         jdk.internal.le,
179         jdk.jshell;
180     exports jdk.internal.jimage to
181         jdk.jlink;
182     exports jdk.internal.jimage.decompressor to
183         jdk.jlink;
184     exports jdk.internal.loader to
185         java.instrument,
186         java.logging,
187         java.naming;
188     exports jdk.internal.jmod to
189         jdk.compiler,
190         jdk.jlink;
191     exports jdk.internal.logger to
192         java.logging;
193     exports jdk.internal.net.quic to
194         java.net.http;
195     exports jdk.internal.org.xml.sax to
196         jdk.jfr;
197     exports jdk.internal.org.xml.sax.helpers to
198         jdk.jfr;
199     exports jdk.internal.misc to
200         java.desktop,
201         java.logging,
202         java.management,
203         java.naming,
204         java.net.http,
205         java.rmi,
206         java.security.jgss,
207         jdk.attach,
208         jdk.charsets,
209         jdk.compiler,
210         jdk.crypto.cryptoki,
211         jdk.incubator.vector,
212         jdk.jfr,
213         jdk.jshell,
214         jdk.nio.mapmode,
215         jdk.unsupported,
216         jdk.internal.vm.ci,
217         jdk.graal.compiler;
218     exports jdk.internal.module to
219         java.instrument,
220         java.management.rmi,
221         jdk.jartool,
222         jdk.compiler,
223         jdk.jfr,
224         jdk.jlink,
225         jdk.jpackage;
226     exports jdk.internal.perf to
227         java.management,
228         jdk.management.agent,
229         jdk.internal.jvmstat;
230     exports jdk.internal.platform to
231         jdk.management,
232         jdk.jfr;
233     exports jdk.internal.ref to
234         java.desktop,
235         java.net.http,
236         jdk.naming.dns;
237     exports jdk.internal.reflect to
238         java.logging,
239         java.sql,
240         java.sql.rowset,
241         jdk.dynalink,
242         jdk.internal.vm.ci,
243         jdk.jdeps,
244         jdk.unsupported;
245     exports jdk.internal.vm to
246         java.management,
247         jdk.internal.jvmstat,
248         jdk.management,
249         jdk.management.agent,
250         jdk.internal.vm.ci,
251         jdk.jfr;
252     exports jdk.internal.vm.annotation to
253         java.instrument,
254         jdk.internal.vm.ci,
255         jdk.incubator.vector,
256         jdk.jfr,
257         jdk.unsupported;
258     exports jdk.internal.vm.vector to
259         jdk.incubator.vector;
260     exports jdk.internal.util.xml to
261         jdk.jfr;
262     exports jdk.internal.util.xml.impl to
263         jdk.jfr;
264     exports jdk.internal.value to  // Needed by Unsafe
265         jdk.unsupported;
266     exports jdk.internal.util to
267         java.desktop,
268         java.prefs,
269         java.security.jgss,
270         java.smartcardio,
271         java.naming,
272         java.rmi,
273         java.net.http,
274         jdk.charsets,
275         jdk.incubator.vector,
276         jdk.internal.vm.ci,
277         jdk.httpserver,
278         jdk.jlink,
279         jdk.jpackage,
280         jdk.net,
281         jdk.security.auth;
282     exports sun.net to
283         java.net.http,
284         jdk.naming.dns;
285     exports sun.net.ext to
286         jdk.net;
287     exports sun.net.dns to
288         java.security.jgss,
289         jdk.naming.dns;
290     exports sun.net.util to
291         java.net.http,
292         jdk.jconsole,
293         jdk.sctp;
294     exports sun.net.www to
295         java.net.http,
296         jdk.jartool;
297     exports sun.net.www.protocol.http to
298         java.security.jgss;
299     exports sun.nio.ch to
300         java.management,
301         jdk.crypto.cryptoki,
302         jdk.net,
303         jdk.sctp;
304     exports sun.nio.cs to
305         jdk.charsets;
306     exports sun.nio.fs to
307         jdk.net;
308     exports sun.reflect.annotation to
309         jdk.compiler;
310     exports sun.reflect.generics.reflectiveObjects to
311         java.desktop;
312     exports sun.reflect.misc to
313         java.desktop,
314         java.management;
315     exports sun.security.internal.interfaces to
316         jdk.crypto.cryptoki;
317     exports sun.security.internal.spec to
318         jdk.crypto.cryptoki;
319     exports sun.security.jca to
320         java.security.sasl,
321         java.smartcardio,
322         jdk.crypto.cryptoki,
323         jdk.naming.dns;
324     exports sun.security.pkcs to
325         jdk.jartool;
326     exports sun.security.provider to
327         java.security.jgss,
328         jdk.crypto.cryptoki,
329         jdk.security.auth;
330     exports sun.security.provider.certpath to
331         java.naming,
332         jdk.jartool;
333     exports sun.security.rsa to
334         jdk.crypto.cryptoki;
335     exports sun.security.timestamp to
336         jdk.jartool;
337     exports sun.security.tools to
338         jdk.jartool;
339     exports sun.security.util to
340         java.naming,
341         java.security.jgss,
342         java.security.sasl,
343         java.smartcardio,
344         java.xml.crypto,
345         jdk.crypto.cryptoki,
346         jdk.jartool,
347         jdk.security.auth,
348         jdk.security.jgss;
349     exports sun.security.x509 to
350         jdk.crypto.cryptoki,
351         jdk.jartool;
352     exports sun.security.validator to
353         jdk.jartool;
354     exports sun.util.cldr to
355         jdk.jlink;
356     exports sun.util.locale.provider to
357         java.desktop,
358         jdk.jlink,
359         jdk.localedata;
360     exports sun.util.logging to
361         java.desktop,
362         java.logging,
363         java.prefs;
364     exports sun.util.resources to
365         jdk.localedata;
366 
367     // the service types defined by the APIs in this module
368 
369     uses java.lang.System.LoggerFinder;
370     uses java.net.ContentHandlerFactory;
371     uses java.net.spi.InetAddressResolverProvider;
372     uses java.net.spi.URLStreamHandlerProvider;
373     uses java.nio.channels.spi.AsynchronousChannelProvider;
374     uses java.nio.channels.spi.SelectorProvider;
375     uses java.nio.charset.spi.CharsetProvider;
376     uses java.nio.file.spi.FileSystemProvider;
377     uses java.nio.file.spi.FileTypeDetector;
378     uses java.security.Provider;
379     uses java.text.spi.BreakIteratorProvider;
380     uses java.text.spi.CollatorProvider;
381     uses java.text.spi.DateFormatProvider;
382     uses java.text.spi.DateFormatSymbolsProvider;
383     uses java.text.spi.DecimalFormatSymbolsProvider;
384     uses java.text.spi.NumberFormatProvider;
385     uses java.time.chrono.AbstractChronology;
386     uses java.time.chrono.Chronology;
387     uses java.time.zone.ZoneRulesProvider;
388     uses java.util.spi.CalendarDataProvider;
389     uses java.util.spi.CalendarNameProvider;
390     uses java.util.spi.CurrencyNameProvider;
391     uses java.util.spi.LocaleNameProvider;
392     uses java.util.spi.ResourceBundleControlProvider;
393     uses java.util.spi.ResourceBundleProvider;
394     uses java.util.spi.TimeZoneNameProvider;
395     uses java.util.spi.ToolProvider;
396     uses javax.security.auth.spi.LoginModule;
397 
398     // JDK-internal service types
399 
400     uses jdk.internal.io.JdkConsoleProvider;
401     uses jdk.internal.logger.DefaultLoggerFinder;
402     uses sun.text.spi.JavaTimeDateTimePatternProvider;
403     uses sun.util.spi.CalendarProvider;
404     uses sun.util.locale.provider.LocaleDataMetaInfo;
405     uses sun.util.resources.LocaleData.LocaleDataResourceBundleProvider;
406 
407     // Built-in service providers that are located via ServiceLoader
408 
409     provides java.nio.file.spi.FileSystemProvider with
410         jdk.internal.jrtfs.JrtFileSystemProvider;
411 
412 }