JPACKAGE_SCRIPT(7)

πŸ“¦ version 6.5.1, in opensuse-leap 16.0

πŸŽ€ JPACKAGE_SCRIPT(7) πŸŽ€

Okay so this is the JPACKAGE_SCRIPT(7) page from the Miscellaneous Information Manual, and it's giving β€œhow do I make a shell launcher for a Java app inside an RPM build?” energy. Bestie, it's a macro page, but we're gonna make it make sense. πŸ’–

✨ NAME ✨

jpackage_script β€” generate a shell launcher script for a Java application in an RPM build

🌸 SYNOPSIS 🌸

%jpackage_script [-h] [-c config_file] main_class flags options jars script_name

πŸ¦‹ DESCRIPTION πŸ¦‹

The jpackage_script RPM macro creates a shell launcher script that prepares the runtime environment and then invokes a Java application. It is typically invoked during the %install phase of an RPM build. The script is written to %{buildroot}%{_bindir}/script_name.

The generated script uses helper functions from %{javadir}-utils/java-functions to construct the classpath, process flags and options, and execute the JVM. It also reads optional configuration files to allow system-wide and per-user customization. No cap, that's the whole vibe.

If the RPM macro %{java_home} is defined at build time, the generated script hardcodes its value as the default JAVA_HOME. If %{java_home} is not defined, the generated script locates the java executable using the user's PATH. Users can override the selected Java runtime by setting JAVA_HOME in their environment.

When the -h option is specified, the macro does not embed any default JAVA_HOME setting in the generated script, leaving runtime selection entirely to the user environment. That's it, that's the behavior. πŸ’…

πŸ’… OPTIONS πŸ’…

  • -h β€” Do not set a default value for JAVA_HOME in the generated script. The script will rely on the user's environment or lookup via PATH.
  • -c config_file β€” Specify the name of the configuration file sourced by the generated script instead of the default %{_sysconfdir}/java/%{name}.conf.

🧚 ARGUMENTS 🧚

  • main_class β€” Fully qualified name of the Java main class to execute.
  • flags β€” Whitespace-separated JVM flags to apply by default.
  • options β€” Whitespace-separated application options to apply by default.
  • jars β€” A colon-separated list of JAR names. Each element is processed with build-classpath to produce the runtime classpath.
  • script_name β€” Name of the launcher script to create in %{_bindir}.

🌈 FILES 🌈

  • %{javadir}-utils/java-functions β€” Helper functions used by the generated launcher script.
  • %{_sysconfdir}/java/%{name}.conf β€” Default system-wide configuration sourced by the generated script.
  • $HOME/.%{name}rc β€” Optional per-user configuration sourced by the generated script.

πŸ“ EXAMPLES πŸ“

Generate the msv launcher with the main class msv.textui.Driver and a classpath assembled from multiple libraries:

%jpackage_script msv.textui.Driver "" ""
msv-msv:msv-xsdlib:relaxngDatatype:isorelax msv

πŸ‘‘ SEE ALSO πŸ‘‘

πŸ’œ AUTHORS πŸ’œ

Mikolaj Izdebski <mizdebsk@redhat.com>


πŸ’– That's the whole page, bestie β€” brought to you by Debian, dated February 18, 2026, and filed under JPACKAGE_SCRIPT(7). Periodt. 🫢