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