Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.jpackage.jmod - JPackage Tool
JDK 17 jdk.jpackage.jmod is the JMOD file for JDK 17 JPackage tool,
which can be invoked by the "jpackage" command.
JDK 17 JPackage tool compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jpackage.jmod.
JDK 17 JPackage tool compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JPackage tool source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jpackage.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/jpackage/internal/CfgFile.java
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package jdk.jpackage.internal;
import java.io.IOException;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import static jdk.jpackage.internal.StandardBundlerParam.LAUNCHER_DATA;
import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME;
import static jdk.jpackage.internal.StandardBundlerParam.JAVA_OPTIONS;
import static jdk.jpackage.internal.StandardBundlerParam.ARGUMENTS;
import static jdk.jpackage.internal.StandardBundlerParam.VERSION;
/**
* App launcher's config file.
*/
final class CfgFile {
CfgFile() {
appLayout = ApplicationLayout.platformAppImage();
}
CfgFile initFromParams(Map<String, ? super Object> params) {
launcherData = LAUNCHER_DATA.fetchFrom(params);
launcherName = APP_NAME.fetchFrom(params);
javaOptions = JAVA_OPTIONS.fetchFrom(params);
arguments = ARGUMENTS.fetchFrom(params);
version = VERSION.fetchFrom(params);
return this;
}
void create(Path appImage) throws IOException {
List<Map.Entry<String, Object>> content = new ArrayList<>();
ApplicationLayout appCfgLayout = createAppCfgLayout();
content.add(Map.entry("[Application]", SECTION_TAG));
if (launcherData.isModular()) {
content.add(Map.entry("app.mainmodule", launcherData.moduleName()
+ "/" + launcherData.qualifiedClassName()));
} else {
// If the app is contained in an unnamed jar then launch it the
// legacy way and the main class string must be
// of the format com/foo/Main
if (launcherData.mainJarName() != null) {
content.add(Map.entry("app.classpath",
appCfgLayout.appDirectory().resolve(
launcherData.mainJarName())));
}
content.add(Map.entry("app.mainclass",
launcherData.qualifiedClassName()));
}
for (var value : launcherData.classPath()) {
content.add(Map.entry("app.classpath",
appCfgLayout.appDirectory().resolve(value).toString()));
}
ApplicationLayout appImagelayout = appLayout.resolveAt(appImage);
Path modsDir = appImagelayout.appModsDirectory();
content.add(Map.entry("[JavaOptions]", SECTION_TAG));
// always let app know it's version
content.add(Map.entry(
"java-options", "-Djpackage.app-version=" + version));
// add user supplied java options if there are any
for (var value : javaOptions) {
content.add(Map.entry("java-options", value));
}
// add module path if there is one
if (Files.isDirectory(modsDir)) {
content.add(Map.entry("java-options", "--module-path"));
content.add(Map.entry("java-options",
appCfgLayout.appModsDirectory()));
}
if (!arguments.isEmpty()) {
content.add(Map.entry("[ArgOptions]", SECTION_TAG));
for (var value : arguments) {
content.add(Map.entry("arguments", value));
}
}
Path cfgFile = appImagelayout.appDirectory().resolve(launcherName + ".cfg");
Files.createDirectories(IOUtils.getParent(cfgFile));
boolean[] addLineBreakAtSection = new boolean[1];
Stream<String> lines = content.stream().map(entry -> {
if (entry.getValue() == SECTION_TAG) {
if (!addLineBreakAtSection[0]) {
addLineBreakAtSection[0] = true;
return entry.getKey();
}
return "\n" + entry.getKey();
}
return entry.getKey() + "=" + entry.getValue();
});
Files.write(cfgFile, (Iterable<String>) lines::iterator);
}
private ApplicationLayout createAppCfgLayout() {
ApplicationLayout appCfgLayout = appLayout.resolveAt(Path.of("$ROOTDIR"));
appCfgLayout.pathGroup().setPath(ApplicationLayout.PathRole.APP,
Path.of("$APPDIR"));
appCfgLayout.pathGroup().setPath(ApplicationLayout.PathRole.MODULES,
appCfgLayout.appDirectory().resolve(appCfgLayout.appModsDirectory().getFileName()));
return appCfgLayout;
}
private String launcherName;
private String version;
private LauncherData launcherData;
List<String> arguments;
List<String> javaOptions;
private final ApplicationLayout appLayout;
private static final Object SECTION_TAG = new Object();
}
⏎ jdk/jpackage/internal/CfgFile.java
Or download all of them as a single archive file:
File name: jdk.jpackage-17.0.5-src.zip File size: 92069 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jshell.jmod - JShell Tool
2023-08-03, ≈10🔥, 0💬
Popular Posts:
JDK 1.1 source code directory contains Java source code for JDK 1.1 core classes: "C:\fyicenter\jdk-...
JDK 17 java.compiler.jmod is the JMOD file for JDK 17 Compiler module. JDK 17 Compiler module compil...
JDK 11 jdk.compiler.jmod is the JMOD file for JDK 11 Compiler tool, which can be invoked by the "jav...
kernel.jar is a component in iText Java library to provide low-level functionalities. iText Java lib...
JDK 11 jdk.jdeps.jmod is the JMOD file for JDK 11 JDeps tool, which can be invoked by the "jdeps" co...