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