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