APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.tools.jlink.internal

public Class JlinkTask

extends Object
Class Inheritance
Static Imports
jdk.tools.jlink.internal.TaskHelper.JLINK_BUNDLE

Implementation for the jlink tool. ## Should use jdk.joptsimple some day.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final String
public static final boolean
pack-priv static final int
EXIT_ABNORMAL

Result codes.

pack-priv static final int
EXIT_CMDERR

Result codes.

pack-priv static final int
EXIT_ERROR

Result codes.

pack-priv static final int
EXIT_OK

Result codes.

pack-priv static final int
EXIT_SYSERR

Result codes.

pack-priv static final boolean
private static final String
private PrintWriter
private final JlinkTask.OptionsValues
public static final String
private static final TaskHelper.OptionsHelper<JlinkTask>
private static final String
private static final TaskHelper.Option<?>[]
private static final TaskHelper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
private void
public static void
private void
private static JlinkTask.ImageHelper
createImageProvider(Jlink.JlinkConfiguration config, Path retainModulesPath, boolean ignoreSigning, boolean bindService, ByteOrder endian, boolean verbose, JlinkTask.OptionsValues opts, PrintWriter log)

private static void
private static String
findModuleName(Path modInfoPath)

private static String
public static Path
getDefaultModulePath()

Returns: the system module path or null

private static Optional<String>
getReleaseInfo(ModuleReference mref)

Read the release.txt from the module.

private String
private Jlink.JlinkConfiguration
private static boolean
public static ModuleFinder
limitFinder(ModuleFinder finder, Set<String> limitMods, Set<String> roots)

private static Archive
newArchive(String module, Path path, Runtime.Version version, boolean ignoreSigning, Jlink.JlinkConfiguration config, PrintWriter log)

public static ModuleFinder
private static void
private static void
printProviders(PrintWriter log, String header, Set<ModuleReference> modules, Map<String, Set<String>> serviceToUses)

private static String
pack-priv int
run(String[] args)

pack-priv void
private void
private static Platform
targetPlatform(Configuration cf, Map<String, Path> modsPaths, boolean runtimeImageLink)

private static Path
private static Map<String, Set<String>>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALL_MODULE_PATHback to summary
private static final String ALL_MODULE_PATH
DEBUGback to summary
public static final boolean DEBUG
EXIT_ABNORMALback to summary
pack-priv static final int EXIT_ABNORMAL

Result codes.

EXIT_CMDERRback to summary
pack-priv static final int EXIT_CMDERR

Result codes.

EXIT_ERRORback to summary
pack-priv static final int EXIT_ERROR

Result codes.

EXIT_OKback to summary
pack-priv static final int EXIT_OK

Result codes.

EXIT_SYSERRback to summary
pack-priv static final int EXIT_SYSERR

Result codes.

IGNORE_SIGNING_DEFAULTback to summary
pack-priv static final boolean IGNORE_SIGNING_DEFAULT
JDK_RELEASE_RESOURCEback to summary
private static final String JDK_RELEASE_RESOURCE
logback to summary
private PrintWriter log
optionsback to summary
private final JlinkTask.OptionsValues options
OPTIONS_RESOURCEback to summary
public static final String OPTIONS_RESOURCE
optionsHelperback to summary
private static final TaskHelper.OptionsHelper<JlinkTask> optionsHelper
PROGNAMEback to summary
private static final String PROGNAME
recognizedOptionsback to summary
private static final TaskHelper.Option<?>[] recognizedOptions
taskHelperback to summary
private static final TaskHelper taskHelper

Constructor Detail

JlinkTaskback to summary
public JlinkTask()

Method Detail

checkJavaBaseVersionback to summary
private static void checkJavaBaseVersion(ModuleReference target)
cleanupOutputback to summary
private void cleanupOutput(Path dir)
createImageback to summary
public static void createImage(Jlink.JlinkConfiguration config, Jlink.PluginsConfiguration plugins) throws Exception
createImageback to summary
private void createImage(Jlink.JlinkConfiguration config) throws Exception
createImageProviderback to summary
private static JlinkTask.ImageHelper createImageProvider(Jlink.JlinkConfiguration config, Path retainModulesPath, boolean ignoreSigning, boolean bindService, ByteOrder endian, boolean verbose, JlinkTask.OptionsValues opts, PrintWriter log) throws IOException
deleteDirectoryback to summary
private static void deleteDirectory(Path dir) throws IOException
findModuleNameback to summary
private static String findModuleName(Path modInfoPath)
getCurrentRuntimeVersionback to summary
private static String getCurrentRuntimeVersion()
getDefaultModulePathback to summary
public static Path getDefaultModulePath()
Returns:Path

the system module path or null

getReleaseInfoback to summary
private static Optional<String> getReleaseInfo(ModuleReference mref)

Read the release.txt from the module.

getSaveOptsback to summary
private String getSaveOpts()
initJlinkConfigback to summary
private Jlink.JlinkConfiguration initJlinkConfig() throws BadArgs
isJavaBaseFromDefaultModulePathback to summary
private static boolean isJavaBaseFromDefaultModulePath(Path javaBasePath) throws IOException
limitFinderback to summary
public static ModuleFinder limitFinder(ModuleFinder finder, Set<String> limitMods, Set<String> roots)
newArchiveback to summary
private static Archive newArchive(String module, Path path, Runtime.Version version, boolean ignoreSigning, Jlink.JlinkConfiguration config, PrintWriter log)
newModuleFinderback to summary
public static ModuleFinder newModuleFinder(List<Path> paths)
printProvidersback to summary
private static void printProviders(PrintWriter log, String header, Set<ModuleReference> modules)
printProvidersback to summary
private static void printProviders(PrintWriter log, String header, Set<ModuleReference> modules, Map<String, Set<String>> serviceToUses)
readJavaBaseTargetPlatformback to summary
private static String readJavaBaseTargetPlatform(Configuration cf) throws IOException
runback to summary
pack-priv int run(String[] args)
setLogback to summary
pack-priv void setLog(PrintWriter out, PrintWriter err)
suggestProvidersback to summary
private void suggestProviders(Jlink.JlinkConfiguration config, List<String> args) throws BadArgs
targetPlatformback to summary
private static Platform targetPlatform(Configuration cf, Map<String, Path> modsPaths, boolean runtimeImageLink) throws IOException
toPathLocationback to summary
private static Path toPathLocation(ResolvedModule m)
usesback to summary
private static Map<String, Set<String>> uses(Set<ModuleReference> modules)
jdk.tools.jlink.internal back to summary

private final Record JlinkTask.ImageHelper

extends Record
implements ImageProvider, AutoCloseable
Class Inheritance
All Implemented Interfaces
java.lang.AutoCloseable, jdk.tools.jlink.internal.ImagePluginStack.ImageProvider
Record Components
archives:Set<Archive> 
targetPlatform:Platform 
packagedModulesPath:Path 
generateRuntimeImage:boolean 

Field Summary

Modifier and TypeField and Description
private final Set<Archive>
archives

Record Component accessed by archives().

private final boolean
generateRuntimeImage

Record Component accessed by generateRuntimeImage().

private final Path
packagedModulesPath

Record Component accessed by packagedModulesPath().

private final Platform
targetPlatform

Record Component accessed by targetPlatform().

Constructor Summary

AccessConstructor and Description
private
ImageHelper(Set<Archive> archives, Platform targetPlatform, Path packagedModulesPath, boolean generateRuntimeImage)

Method Summary

Modifier and TypeMethod and Description
public Set<Archive>
archives()

Record Component getter of archives.

public void
close()

Implements java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public boolean
generateRuntimeImage()

Record Component getter of generateRuntimeImage.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public Path
packagedModulesPath()

Record Component getter of packagedModulesPath.

public ExecutableImage
public Platform
targetPlatform()

Record Component getter of targetPlatform.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

archivesback to summary
private final Set<Archive> archives

Record Component accessed by archives().

generateRuntimeImageback to summary
private final boolean generateRuntimeImage

Record Component accessed by generateRuntimeImage().

packagedModulesPathback to summary
private final Path packagedModulesPath

Record Component accessed by packagedModulesPath().

targetPlatformback to summary
private final Platform targetPlatform

Record Component accessed by targetPlatform().

Constructor Detail

ImageHelperback to summary
private ImageHelper(Set<Archive> archives, Platform targetPlatform, Path packagedModulesPath, boolean generateRuntimeImage)

Method Detail

archivesback to summary
public Set<Archive> archives()

Record Component getter of archives.

closeback to summary
public void close() throws IOException

Implements java.lang.AutoCloseable.close.

Doc from java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

Annotations
@Override
equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
generateRuntimeImageback to summary
public boolean generateRuntimeImage()

Record Component getter of generateRuntimeImage.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

packagedModulesPathback to summary
public Path packagedModulesPath()

Record Component getter of packagedModulesPath.

retrieveback to summary
public ExecutableImage retrieve(ImagePluginStack stack) throws IOException

Implements jdk.tools.jlink.internal.ImagePluginStack.ImageProvider.retrieve.

Annotations
@Override
targetPlatformback to summary
public Platform targetPlatform()

Record Component getter of targetPlatform.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

jdk.tools.jlink.internal back to summary

pack-priv Class JlinkTask.OptionsValues

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final Set<String>
pack-priv boolean
pack-priv ByteOrder
pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv final Map<String, String>
pack-priv final Set<String>
pack-priv final List<Path>
pack-priv Path
pack-priv Path
pack-priv String
pack-priv boolean
pack-priv boolean
pack-priv boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

addModsback to summary
pack-priv final Set<String> addMods
bindServicesback to summary
pack-priv boolean bindServices
endianback to summary
pack-priv ByteOrder endian
fullVersionback to summary
pack-priv boolean fullVersion
generateLinkableRuntimeback to summary
pack-priv boolean generateLinkableRuntime
helpback to summary
pack-priv boolean help
ignoreModifiedRuntimeback to summary
pack-priv boolean ignoreModifiedRuntime
ignoreSigningback to summary
pack-priv boolean ignoreSigning
launchersback to summary
pack-priv final Map<String, String> launchers
limitModsback to summary
pack-priv final Set<String> limitMods
modulePathback to summary
pack-priv final List<Path> modulePath
outputback to summary
pack-priv Path output
packagedModulesPathback to summary
pack-priv Path packagedModulesPath
saveoptsfileback to summary
pack-priv String saveoptsfile
suggestProvidersback to summary
pack-priv boolean suggestProviders
verboseback to summary
pack-priv boolean verbose
versionback to summary
pack-priv boolean version

Constructor Detail

OptionsValuesback to summary
pack-priv OptionsValues()