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