1 /*
  2  * Copyright (c) 2014, 2022, 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.management, // participates in preview features
151         jdk.compiler,
152         jdk.incubator.concurrent, // participates in preview features
153         jdk.incubator.vector, // participates in preview features
154         jdk.jdi,
155         jdk.jfr,
156         jdk.jshell,
157         jdk.management;
158     exports jdk.internal.access to
159         java.desktop,
160         java.logging,
161         java.management,
162         java.naming,
163         java.rmi,
164         jdk.charsets,
165         jdk.jartool,
166         jdk.jlink,
167         jdk.jfr,
168         jdk.net,
169         jdk.incubator.concurrent,
170         jdk.sctp,
171         jdk.crypto.cryptoki;
172     exports jdk.internal.foreign to
173         jdk.incubator.vector;
174     exports jdk.internal.event to
175         jdk.jfr;
176     exports jdk.internal.io to
177         jdk.internal.le,
178         jdk.jshell;
179     exports jdk.internal.jimage to
180         jdk.jlink;
181     exports jdk.internal.jimage.decompressor to
182         jdk.jlink;
183     exports jdk.internal.loader to
184         java.instrument,
185         java.logging,
186         java.naming;
187     exports jdk.internal.jmod to
188         jdk.compiler,
189         jdk.jlink;
190     exports jdk.internal.logger to
191         java.logging;
192     exports jdk.internal.org.objectweb.asm to
193         jdk.jartool,
194         jdk.jfr,
195         jdk.jlink,
196         jdk.jshell;
197     exports jdk.internal.org.objectweb.asm.tree to
198         jdk.jfr,
199         jdk.jlink;
200     exports jdk.internal.org.objectweb.asm.util to
201         jdk.jfr;
202     exports jdk.internal.org.objectweb.asm.commons to
203         jdk.jfr;
204     exports jdk.internal.org.xml.sax to
205         jdk.jfr;
206     exports jdk.internal.org.xml.sax.helpers to
207         jdk.jfr;
208     exports jdk.internal.misc to
209         java.desktop,
210         java.logging,
211         java.management,
212         java.naming,
213         java.net.http,
214         java.rmi,
215         java.security.jgss,
216         jdk.attach,
217         jdk.charsets,
218         jdk.compiler,
219         jdk.crypto.cryptoki,
220         jdk.incubator.concurrent,
221         jdk.incubator.vector,
222         jdk.jfr,
223         jdk.jshell,
224         jdk.nio.mapmode,
225         jdk.unsupported,
226         jdk.internal.vm.ci;
227     exports jdk.internal.module to
228         java.instrument,
229         java.management.rmi,
230         jdk.jartool,
231         jdk.jfr,
232         jdk.jlink,
233         jdk.jpackage;
234     exports jdk.internal.perf to
235         java.management,
236         jdk.management.agent,
237         jdk.internal.jvmstat;
238     exports jdk.internal.platform to
239         jdk.management,
240         jdk.jfr;
241     exports jdk.internal.ref to
242         java.desktop,
243         java.net.http;
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.incubator.concurrent,
254         jdk.internal.jvmstat,
255         jdk.management,
256         jdk.management.agent;
257     exports jdk.internal.vm.annotation to
258         java.instrument,
259         jdk.internal.vm.ci,
260         jdk.incubator.concurrent,
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.jar to
267         jdk.jartool;
268     exports jdk.internal.util.xml to
269         jdk.jfr;
270     exports jdk.internal.util.xml.impl to
271         jdk.jfr;
272     exports jdk.internal.util.random to
273         jdk.random;
274     exports jdk.internal.value to  // Needed by Unsafe
275         jdk.unsupported;
276     exports sun.net to
277         java.net.http,
278         jdk.naming.dns;
279     exports sun.net.ext to
280         jdk.net;
281     exports sun.net.dns to
282         java.security.jgss,
283         jdk.naming.dns;
284     exports sun.net.util to
285         java.desktop,
286         java.net.http,
287         jdk.jconsole,
288         jdk.sctp;
289     exports sun.net.www to
290         java.net.http,
291         jdk.jartool;
292     exports sun.net.www.protocol.http to
293         java.security.jgss;
294     exports sun.nio.ch to
295         java.management,
296         jdk.crypto.cryptoki,
297         jdk.net,
298         jdk.sctp;
299     exports sun.nio.cs to
300         jdk.charsets;
301     exports sun.nio.fs to
302         jdk.net;
303     exports sun.reflect.annotation to
304         jdk.compiler;
305     exports sun.reflect.generics.reflectiveObjects to
306         java.desktop;
307     exports sun.reflect.misc to
308         java.desktop,
309         java.datatransfer,
310         java.management,
311         java.management.rmi,
312         java.rmi,
313         java.sql.rowset;
314     exports sun.security.action to
315         java.desktop,
316         java.security.jgss,
317         jdk.crypto.ec,
318         jdk.incubator.concurrent;
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.ec,
326         jdk.crypto.cryptoki,
327         jdk.naming.dns;
328     exports sun.security.pkcs to
329         jdk.crypto.ec,
330         jdk.jartool;
331     exports sun.security.provider to
332         java.rmi,
333         java.security.jgss,
334         jdk.crypto.cryptoki,
335         jdk.crypto.ec,
336         jdk.security.auth;
337     exports sun.security.provider.certpath to
338         java.naming,
339         jdk.jartool;
340     exports sun.security.rsa to
341         jdk.crypto.cryptoki;
342     exports sun.security.timestamp to
343         jdk.jartool;
344     exports sun.security.tools to
345         jdk.jartool;
346     exports sun.security.util to
347         java.desktop,
348         java.naming,
349         java.rmi,
350         java.security.jgss,
351         java.security.sasl,
352         java.smartcardio,
353         java.xml.crypto,
354         jdk.crypto.ec,
355         jdk.crypto.cryptoki,
356         jdk.jartool,
357         jdk.security.auth,
358         jdk.security.jgss;
359     exports sun.security.util.math to
360         jdk.crypto.ec;
361     exports sun.security.util.math.intpoly to
362         jdk.crypto.ec;
363     exports sun.security.x509 to
364         jdk.crypto.ec,
365         jdk.crypto.cryptoki,
366         jdk.jartool;
367     exports sun.security.validator to
368         jdk.jartool;
369     exports sun.util.cldr to
370         jdk.jlink;
371     exports sun.util.locale.provider to
372         java.desktop,
373         jdk.jlink,
374         jdk.localedata;
375     exports sun.util.logging to
376         java.desktop,
377         java.logging,
378         java.prefs;
379     exports sun.util.resources to
380         jdk.localedata;
381 
382     // the service types defined by the APIs in this module
383 
384     uses java.lang.System.LoggerFinder;
385     uses java.net.ContentHandlerFactory;
386     uses java.net.spi.InetAddressResolverProvider;
387     uses java.net.spi.URLStreamHandlerProvider;
388     uses java.nio.channels.spi.AsynchronousChannelProvider;
389     uses java.nio.channels.spi.SelectorProvider;
390     uses java.nio.charset.spi.CharsetProvider;
391     uses java.nio.file.spi.FileSystemProvider;
392     uses java.nio.file.spi.FileTypeDetector;
393     uses java.security.Provider;
394     uses java.text.spi.BreakIteratorProvider;
395     uses java.text.spi.CollatorProvider;
396     uses java.text.spi.DateFormatProvider;
397     uses java.text.spi.DateFormatSymbolsProvider;
398     uses java.text.spi.DecimalFormatSymbolsProvider;
399     uses java.text.spi.NumberFormatProvider;
400     uses java.time.chrono.AbstractChronology;
401     uses java.time.chrono.Chronology;
402     uses java.time.zone.ZoneRulesProvider;
403     uses java.util.random.RandomGenerator;
404     uses java.util.spi.CalendarDataProvider;
405     uses java.util.spi.CalendarNameProvider;
406     uses java.util.spi.CurrencyNameProvider;
407     uses java.util.spi.LocaleNameProvider;
408     uses java.util.spi.ResourceBundleControlProvider;
409     uses java.util.spi.ResourceBundleProvider;
410     uses java.util.spi.TimeZoneNameProvider;
411     uses java.util.spi.ToolProvider;
412     uses javax.security.auth.spi.LoginModule;
413 
414     // JDK-internal service types
415 
416     uses jdk.internal.io.JdkConsoleProvider;
417     uses jdk.internal.logger.DefaultLoggerFinder;
418     uses sun.text.spi.JavaTimeDateTimePatternProvider;
419     uses sun.util.spi.CalendarProvider;
420     uses sun.util.locale.provider.LocaleDataMetaInfo;
421     uses sun.util.resources.LocaleData.CommonResourceBundleProvider;
422     uses sun.util.resources.LocaleData.SupplementaryResourceBundleProvider;
423 
424     // Built-in service providers that are located via ServiceLoader
425 
426     provides java.nio.file.spi.FileSystemProvider with
427         jdk.internal.jrtfs.JrtFileSystemProvider;
428 
429     provides java.util.random.RandomGenerator with
430         java.security.SecureRandom,
431         java.util.Random,
432         java.util.SplittableRandom;
433 
434 }