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