1 /*
  2  * Copyright (c) 2014, 2025, 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 
139     // additional qualified exports may be inserted at build time
140     // see make/gensrc/GenModuleInfo.gmk
141 
142     exports com.sun.crypto.provider to
143         jdk.crypto.cryptoki;
144     exports sun.invoke.util to
145         jdk.compiler;
146     exports com.sun.security.ntlm to
147         java.security.sasl;
148     exports jdk.internal to
149         jdk.incubator.vector;
150     // Note: all modules in the exported list participate in preview  features
151     // and therefore if they use preview features they do not need to be
152     // compiled with "--enable-preview".
153     // It is recommended for any modules that do participate that their
154     // module declaration be annotated with jdk.internal.javac.ParticipatesInPreview
155     exports jdk.internal.javac to
156         java.compiler,
157         java.desktop, // for ScopedValue
158         jdk.compiler,
159         jdk.incubator.vector, // participates in preview features
160         jdk.jartool, // participates in preview features
161         jdk.jdeps, // participates in preview features
162         jdk.jfr, // participates in preview features
163         jdk.jlink,   // participates in preview features
164         jdk.jshell, // participates in preview features
165         jdk.incubator.code; // participates in preview features
166     exports jdk.internal.access to
167         java.desktop,
168         java.logging,
169         java.management,
170         java.rmi,
171         jdk.charsets,
172         jdk.jartool,
173         jdk.jlink,
174         jdk.jfr,
175         jdk.management,
176         jdk.net,
177         jdk.sctp,
178         jdk.crypto.cryptoki,
179         jdk.incubator.code;
180     exports jdk.internal.classfile.components to
181         jdk.jfr;
182     exports jdk.internal.foreign to
183         jdk.incubator.vector;
184     exports jdk.internal.event to
185         jdk.jfr;
186     exports jdk.internal.io to
187         jdk.internal.le,
188         jdk.jshell;
189     exports jdk.internal.jimage to
190         jdk.jlink;
191     exports jdk.internal.jimage.decompressor to
192         jdk.jlink;
193     exports jdk.internal.loader to
194         java.instrument,
195         java.logging,
196         java.naming;
197     exports jdk.internal.jmod to
198         jdk.compiler,
199         jdk.jlink;
200     exports jdk.internal.logger to
201         java.logging;
202     exports jdk.internal.org.xml.sax to
203         jdk.jfr;
204     exports jdk.internal.org.xml.sax.helpers to
205         jdk.jfr;
206     exports jdk.internal.misc to
207         java.desktop,
208         java.logging,
209         java.management,
210         java.naming,
211         java.net.http,
212         java.rmi,
213         java.security.jgss,
214         jdk.attach,
215         jdk.charsets,
216         jdk.compiler,
217         jdk.crypto.cryptoki,
218         jdk.incubator.vector,
219         jdk.jfr,
220         jdk.jshell,
221         jdk.nio.mapmode,
222         jdk.unsupported,
223         jdk.internal.vm.ci,
224         jdk.graal.compiler;
225     exports jdk.internal.module to
226         java.instrument,
227         java.management.rmi,
228         jdk.jartool,
229         jdk.compiler,
230         jdk.jfr,
231         jdk.jlink,
232         jdk.jpackage;
233     exports jdk.internal.perf to
234         java.management,
235         jdk.management.agent,
236         jdk.internal.jvmstat;
237     exports jdk.internal.platform to
238         jdk.management,
239         jdk.jfr;
240     exports jdk.internal.ref to
241         java.desktop,
242         java.net.http,
243         jdk.naming.dns;
244     exports jdk.internal.reflect to
245         java.logging,
246         java.sql,
247         java.sql.rowset,
248         jdk.dynalink,
249         jdk.internal.vm.ci,
250         jdk.unsupported;
251     exports jdk.internal.vm to
252         java.management,
253         jdk.internal.jvmstat,
254         jdk.management,
255         jdk.management.agent,
256         jdk.internal.vm.ci,
257         jdk.jfr;
258     exports jdk.internal.vm.annotation to
259         java.instrument,
260         jdk.internal.vm.ci,
261         jdk.incubator.vector,
262         jdk.jfr,
263         jdk.unsupported;
264     exports jdk.internal.vm.vector to
265         jdk.incubator.vector;
266     exports jdk.internal.util.xml to
267         jdk.jfr;
268     exports jdk.internal.util.xml.impl to
269         jdk.jfr;
270     exports jdk.internal.util to
271         java.desktop,
272         java.prefs,
273         java.security.jgss,
274         java.smartcardio,
275         java.naming,
276         java.rmi,
277         java.net.http,
278         jdk.charsets,
279         jdk.incubator.vector,
280         jdk.internal.vm.ci,
281         jdk.httpserver,
282         jdk.jlink,
283         jdk.jpackage,
284         jdk.net;
285     exports sun.net to
286         java.net.http,
287         jdk.naming.dns;
288     exports sun.net.ext to
289         jdk.net;
290     exports sun.net.dns to
291         java.security.jgss,
292         jdk.naming.dns;
293     exports sun.net.util to
294         java.net.http,
295         jdk.jconsole,
296         jdk.sctp;
297     exports sun.net.www to
298         java.net.http,
299         jdk.jartool;
300     exports sun.net.www.protocol.http to
301         java.security.jgss;
302     exports sun.nio.ch to
303         java.management,
304         jdk.crypto.cryptoki,
305         jdk.net,
306         jdk.sctp;
307     exports sun.nio.cs to
308         jdk.charsets;
309     exports sun.nio.fs to
310         jdk.net;
311     exports sun.reflect.annotation to
312         jdk.compiler;
313     exports sun.reflect.generics.reflectiveObjects to
314         java.desktop,
315         jdk.incubator.code;
316     exports sun.reflect.misc to
317         java.desktop,
318         java.management;
319     exports sun.security.internal.interfaces to
320         jdk.crypto.cryptoki;
321     exports sun.security.internal.spec to
322         jdk.crypto.cryptoki;
323     exports sun.security.jca to
324         java.smartcardio,
325         jdk.crypto.cryptoki,
326         jdk.naming.dns;
327     exports sun.security.pkcs to
328         jdk.jartool;
329     exports sun.security.provider to
330         java.security.jgss,
331         jdk.crypto.cryptoki,
332         jdk.security.auth;
333     exports sun.security.provider.certpath to
334         java.naming,
335         jdk.jartool;
336     exports sun.security.rsa to
337         jdk.crypto.cryptoki;
338     exports sun.security.timestamp to
339         jdk.jartool;
340     exports sun.security.tools to
341         jdk.jartool;
342     exports sun.security.util to
343         java.naming,
344         java.security.jgss,
345         java.security.sasl,
346         java.smartcardio,
347         java.xml.crypto,
348         jdk.crypto.cryptoki,
349         jdk.jartool,
350         jdk.security.auth,
351         jdk.security.jgss;
352     exports sun.security.x509 to
353         jdk.crypto.cryptoki,
354         jdk.jartool;
355     exports sun.security.validator to
356         jdk.jartool;
357     exports sun.util.cldr to
358         jdk.jlink;
359     exports sun.util.locale.provider to
360         java.desktop,
361         jdk.jlink,
362         jdk.localedata;
363     exports sun.util.logging to
364         java.desktop,
365         java.logging,
366         java.prefs;
367     exports sun.util.resources to
368         jdk.localedata;
369 
370     // the service types defined by the APIs in this module
371 
372     uses java.lang.System.LoggerFinder;
373     uses java.net.ContentHandlerFactory;
374     uses java.net.spi.InetAddressResolverProvider;
375     uses java.net.spi.URLStreamHandlerProvider;
376     uses java.nio.channels.spi.AsynchronousChannelProvider;
377     uses java.nio.channels.spi.SelectorProvider;
378     uses java.nio.charset.spi.CharsetProvider;
379     uses java.nio.file.spi.FileSystemProvider;
380     uses java.nio.file.spi.FileTypeDetector;
381     uses java.security.Provider;
382     uses java.text.spi.BreakIteratorProvider;
383     uses java.text.spi.CollatorProvider;
384     uses java.text.spi.DateFormatProvider;
385     uses java.text.spi.DateFormatSymbolsProvider;
386     uses java.text.spi.DecimalFormatSymbolsProvider;
387     uses java.text.spi.NumberFormatProvider;
388     uses java.time.chrono.AbstractChronology;
389     uses java.time.chrono.Chronology;
390     uses java.time.zone.ZoneRulesProvider;
391     uses java.util.spi.CalendarDataProvider;
392     uses java.util.spi.CalendarNameProvider;
393     uses java.util.spi.CurrencyNameProvider;
394     uses java.util.spi.LocaleNameProvider;
395     uses java.util.spi.ResourceBundleControlProvider;
396     uses java.util.spi.ResourceBundleProvider;
397     uses java.util.spi.TimeZoneNameProvider;
398     uses java.util.spi.ToolProvider;
399     uses javax.security.auth.spi.LoginModule;
400 
401     // JDK-internal service types
402 
403     uses jdk.internal.io.JdkConsoleProvider;
404     uses jdk.internal.logger.DefaultLoggerFinder;
405     uses sun.text.spi.JavaTimeDateTimePatternProvider;
406     uses sun.util.spi.CalendarProvider;
407     uses sun.util.locale.provider.LocaleDataMetaInfo;
408     uses sun.util.resources.LocaleData.CommonResourceBundleProvider;
409     uses sun.util.resources.LocaleData.SupplementaryResourceBundleProvider;
410 
411     // Built-in service providers that are located via ServiceLoader
412 
413     provides java.nio.file.spi.FileSystemProvider with
414         jdk.internal.jrtfs.JrtFileSystemProvider;
415 
416 }