JAVA-WRAPPERS(7)

โœจ JAVA-WRAPPERS โœจ

okay so bestie, welcome to java-wrappers(7) ๐Ÿ’– this is the group chat lore for the little shell scripts that run your Java stuff.


๐ŸŒธ NAME ๐ŸŒธ

java-wrappers โ€” the capacities shared by java wrapper scripts ๐Ÿ’…


๐ŸŽ€ DESCRIPTION ๐ŸŽ€

So, like, most Java programs are not run directly. They get run through tiny shell scripts that handle all the annoying background stuff โ€” finding a Java environment that actually works, hunting down libraries, that whole vibe. ๐Ÿฆ‹

To make life easier for the maintainers, those scripts lean on a library that does runtime detection, library detection, and a bunch of other features. This manual page is literally the explainer for all the features those scripts share, and it tells you how far you can configure them. And the configuring? Mostly through environment variables. periodt. ๐Ÿ’…


๐ŸŒˆ ENVIRONMENT VARIABLES ๐ŸŒˆ

java-wrappers understands some environment variables, and here they are:

  • JAVA_CMD โ€” the java command that's gonna be run. If this one's set, it disables all lookup for a java runtime. Like, all of it. ๐Ÿ‘‘
  • JAVA_BINDIR โ€” names a directory that will be searched for a java or a jdb executable (which one depends on how JAVA_DEBUGGER is set). It has precedence over JAVA_HOME โ€” but not over JAVA_CMD.
  • JAVA_HOME โ€” a path to a Java runtime. If it's set, all lookup for a Java runtime is disabled, except that if no java executable is found in the path, the command java is used.
  • JAVA_FLAVOR โ€” a probably-more-easy-to-use version of the JAVA_HOME variable ๐Ÿ’– instead of giving the full path of the Java runtime, you just name it. The list of available flavors lives in the file /usr/lib/java-wrappers/jvm-list.sh. See the examples below bestie, they got you.
  • JAVA_DEBUGGER โ€” if this is set, the wrapper will try to pick up a Java debugger rather than a Java interpreter. This will fail if the jbd of the runtime found is a stub. ๐Ÿ˜ญ
  • JAVA_CLASSPATH โ€” extra classpath, and it gets priority over the one the wrapper found.
  • JAVA_ARGS โ€” additional arguments to the java command. They will come before all other arguments.
  • FORCE_CLASSPATH โ€” if this variable is set, it will be the only classpath. You'd better know what you are doing. ๐Ÿ’€
  • DEBUG_WRAPPER โ€” this is probably the most important variable; if it's set, the wrapper will print out useful info as it goes about its business, like which runtime it actually found and which command gets run eventually. ๐ŸŒŸ
  • JAVA_JARPATH โ€” the path where the wrappers will go looking for jar archives. If it's not set, the wrapper looks into the default directory, /usr/share/java.
โš ๏ธ Warning: the wrapper will not look anywhere else than in JAVA_JARPATH. Setting it incorrectly will most probably result in early crashes. not me finding out the hard way ๐Ÿ™ˆ

๐Ÿงš EXAMPLES ๐Ÿงš

All of these examples rely on rasterizer(1), from the package libbatik-java, but they really apply to all scripts that use java-wrappers. slay. ๐Ÿ’…

Print out debugging information:

DEBUG_WRAPPER=1 rasterizer

Limit rasterizer's memory to 80 MB:

JAVA_ARGS=-Xmx80m rasterizer

Force rasterizer to run with kaffe(1):

JAVA_HOME=/usr/lib/kaffe rasterizer

The same, but using JAVA_BINDIR:

JAVA_BINDIR=/usr/lib/kaffe/bin rasterizer

Force rasterizer to run with openjdk:

JAVA_FLAVOR=openjdk rasterizer

Debug rasterizer with Sun's debugger, while printing debugging information from the wrapper:

DEBUG_WRAPPER=1 JAVA_CMD=/usr/lib/jvm/java-6-sun/bin/jdb rasterizer

๐Ÿ’€ BUGS ๐Ÿ’€

Care has been taken to make the wrappers bug-free. If that was not the case... ๐Ÿ˜ญ please file a bug report against the java-wrappers package.

If you wish to submit any problem with a Java executable relying on java-wrappers, please also submit the output of the command run with DEBUG_WRAPPER=1. It will save one mail exchange and therefore potentially reduce the time it takes to fix the bug. (it's giving considerate. we love that for us ๐Ÿซถ)


๐Ÿ‘‘ DEVELOPERS ๐Ÿ‘‘

There is currently no documentation about writing a wrapper script, save the comments in /usr/lib/java-wrappers/java-wrappers.sh. If you have to write one, we suggest you base yourself upon, for instance, the rasterizer wrapper script, or any other one โ€” just pick up any direct reverse dependency of java-wrappers and look for scripts. iykyk ๐Ÿ’…


โญ SEE ALSO โญ


๐Ÿ“ AUTHOR ๐Ÿ“

java-wrappers and its documentation were written by Vincent Fourmond <fourmond@debian.org> ๐Ÿ’–


Version 0.1.16 ยท 2010-05-04 โ€” that's the tea bestie, the JAVA-WRAPPERS(7) page, dated way back and still iconic. go forth and wrapper. ๐ŸŒˆโœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from