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โ thejavacommand 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 ajavaor ajdbexecutable (which one depends on howJAVA_DEBUGGERis set). It has precedence overJAVA_HOMEโ but not overJAVA_CMD.JAVA_HOMEโ a path to a Java runtime. If it's set, all lookup for a Java runtime is disabled, except that if nojavaexecutable is found in the path, the commandjavais used.JAVA_FLAVORโ a probably-more-easy-to-use version of theJAVA_HOMEvariable ๐ 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 thejbdof 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 thejavacommand. 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
- debian bookworm: java-wrappers 0.4 ยท LGPL-2.1-or-later
- debian trixie: java-wrappers 0.5 ยท LGPL-2.1-or-later
- ubuntu jammy: java-wrappers 0.3
- ubuntu noble: java-wrappers 0.4 ยท LGPL-2.1-or-later
- ubuntu questing: java-wrappers 0.5
- ubuntu resolute: java-wrappers 0.5build1 ยท LGPL-2.1-or-later
- ubuntu stonking: java-wrappers 0.5build1 ยท LGPL-2.1-or-later
- Copyright 2008 by Vincent Fourmond
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms