├── tests ├── .gitignore ├── TestJavaFX.jar ├── Makefile └── TestJavaFX.java ├── .github └── workflows │ └── ci.yml ├── Makefile ├── LICENSE ├── README.md ├── CHANGES.md └── archlinux-java-run.sh /tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | -------------------------------------------------------------------------------- /tests/TestJavaFX.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaellass/archlinux-java-run/HEAD/tests/TestJavaFX.jar -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all clean 2 | 3 | all: TestJavaFX.jar 4 | 5 | TestJavaFX.jar: TestJavaFX.java 6 | javac $^ 7 | jar -cfe TestJavaFX.jar TestJavaFX TestJavaFX.class FXApplication.class 8 | 9 | clean: 10 | rm -f *.class 11 | -------------------------------------------------------------------------------- /tests/TestJavaFX.java: -------------------------------------------------------------------------------- 1 | import javafx.application.Application; 2 | import javafx.stage.Stage; 3 | 4 | public class TestJavaFX { 5 | public static void main (String[] args) { 6 | try { 7 | FXApplication testapp = new FXApplication(); 8 | } catch (NoClassDefFoundError e) { 9 | System.exit(1); 10 | } 11 | System.exit(0); 12 | } 13 | } 14 | 15 | class FXApplication extends Application { 16 | @Override 17 | public void start(Stage primaryStage) throws Exception {} 18 | } 19 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | workflow_dispatch: 11 | 12 | jobs: 13 | shellcheck: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: ludeeus/action-shellcheck@2.0.0 18 | build-tests: 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/checkout@v4 22 | - uses: actions/setup-java@v4 23 | with: 24 | distribution: zulu 25 | java-version: 8 26 | java-package: jdk+fx 27 | - run: cd tests && make -B 28 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PREFIX = /usr/local 2 | BINDIR = $(PREFIX)/bin 3 | JAVADIR = $(PREFIX)/share/java 4 | LICENSEDIR = $(PREFIX)/share/licenses 5 | DOCDIR = $(PREFIX)/share/doc 6 | 7 | JARS = tests/TestJavaFX.jar 8 | 9 | .PHONY: install tests clean 10 | 11 | install: 12 | tmpfile=`mktemp`; \ 13 | echo "Using temporary file $$tmpfile"; \ 14 | sed 's|###JAVADIR###|$(JAVADIR)|g' archlinux-java-run.sh > "$$tmpfile"; \ 15 | install -Dm 755 "$$tmpfile" $(DESTDIR)$(BINDIR)/archlinux-java-run; \ 16 | rm "$$tmpfile" 17 | install -dm 755 $(DESTDIR)$(JAVADIR)/archlinux-java-run 18 | cp $(JARS) $(DESTDIR)$(JAVADIR)/archlinux-java-run/ 19 | install -Dm 644 LICENSE $(DESTDIR)$(LICENSEDIR)/archlinux-java-run/LICENSE 20 | install -Dm 644 README.md $(DESTDIR)$(DOCDIR)/archlinux-java-run/README.md 21 | install -Dm 644 CHANGES.md $(DESTDIR)$(DOCDIR)/archlinux-java-run/CHANGES.md 22 | 23 | tests: 24 | $(MAKE) -C tests 25 | 26 | clean: 27 | $(MAKE) -C tests clean 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017, 2018, 2019, 2020, 2023, 2024 Michael Lass 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # archlinux-java-run 2 | Java Application Launcher for Arch Linux 3 | 4 | archlinux-java-run is a helper script used to launch Java applications 5 | that have specific demands on version or provider of the used JVM. 6 | Options can be arbitrarily combined and archlinux-java-run will try to 7 | find a suitable version. If the user's default JVM is eligible, it will 8 | be used. Otherwise, if multiple eligible versions are installed, the 9 | newest Java generation is used. If multiple packages are available for 10 | this version, the one corresponding to the user's default JVM is used. 11 | 12 | By default, archlinux-java-run will execute a suitable version of java 13 | with the given JAVA_ARGS. When run with -j|--java-home, it just prints 14 | the location of a suitable java installation so that custom commands 15 | can be run. 16 | 17 | ## Usage 18 | ``` 19 | archlinux-java-run [-a|--min MIN] [-b|--max MAX] [-p|--package PKG] 20 | [-f|--feature FEATURE] [-h|--help] [-v|--verbose] 21 | [-d|--dry-run] [-j|--java-home] 22 | -- JAVA_ARGS 23 | ``` 24 | 25 | ## Available features 26 | 27 | * javafx: Test if JVM provides support for JavaFX. For JVM versions above 8 28 | this will modify the module path and the list of loaded modules to make 29 | JavaFX available. **CAUTION**: Software developed for Java >8 using JavaFX 30 | typically provides and loads its own copy of OpenJFX. The feature should not 31 | be requested in this case. 32 | 33 | * jdk: Test if the installation is a full JDK and not just a JRE, i.e., it 34 | includes javac. 35 | 36 | ## Examples 37 | * Launch java in version 8 or below: 38 | `archlinux-java-run --max 8 -- -jar /path/to/application.jar` 39 | 40 | * Launch Oracle's java from one of the jre or jdk AUR packages: 41 | `archlinux-java-run --package 'jre/jre|jdk' -- -jar /path/to/application.jar` 42 | 43 | * Launch a JVM that supports JavaFX: 44 | `archlinux-java-run --feature 'javafx' -- -jar /path/to/application.jar` 45 | 46 | * Launch javac from a JDK in version 11 or newer: 47 | `JAVA_HOME=$(archlinux-java-run --min 11 --feature jdk --java-home) && "$JAVA_HOME"/bin/javac ...` 48 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## v11 4 | 2025-01-03 5 | 6 | * Support more naming schemes, such as ${prefix}[-]${version}-${suffix} (#10) 7 | * Do not hardcode min and max versions 8 | * Minor code cleanup based on shellcheck suggestions 9 | 10 | ## v10 11 | 2023-09-24 12 | 13 | * Increase default max version from 20 to 30 14 | 15 | ## v9 16 | 2020-12-14 17 | 18 | * Support JREs named ${package}-${version} instead of 19 | java-${version}-${package}, such as the zulu packages in AUR (#7) 20 | * Send all unrequested output to stderr instead of stdout 21 | * Miscellaneous code cleanup 22 | 23 | ## v8 24 | 2020-08-04 25 | 26 | * Fix handling of quoted java_args that contain spaces (#2) 27 | * Clean up code by resolving potential issues identified by shellcheck (#2, #3) 28 | 29 | ## v7 30 | 2020-03-27 31 | 32 | * Add jdk as new testable feature. This checks for the presence of 33 | javac. 34 | * Add -d|--dry-run command line argument to just output the generated 35 | command instead of executing it. 36 | * Add -j|--java-home command line argument just print java location 37 | instead of executing java. This allows to use archlinux-java-run to 38 | determine a suitable value for JAVA_HOME or to run a certain version 39 | of executables different to java. See help output for an example. 40 | 41 | ## v6 42 | 2019-11-18 43 | 44 | * Extend javafx feature detection to work for Java versions 9 and 45 | higher. If available, archlinux-java-run will automatically 46 | extend the module path and the list of loaded modules to make 47 | JavaFX available. 48 | * Add -v|--verbose command line argument to enable verbose mode. 49 | archlinux-java-run will output all performed tests as well as the 50 | finally executed command. 51 | * Restructure code to help performance and readability. 52 | 53 | ## v5 54 | 2019-03-23 55 | 56 | * Detect features (for now only JavaFX) using proper tests instead of 57 | looking for properties files 58 | * Include a rudamentary build system 59 | * Improve help output 60 | 61 | ## v4 62 | 2018-04-08 63 | 64 | * Allow requesting certain features like JavaFX. If specified, 65 | archlinux-java-run checks for a corresponding properties file before 66 | marking a JRE as eligible 67 | * Fix check for non-empty list of eligible JREs 68 | * Increase default upper bound for version number 69 | * Small updates to documentation 70 | 71 | ## v3 72 | 2017-12-24 73 | 74 | * Use exec to replace launcher by launched java process 75 | * Fix broken fallback JVM selection in rare cases 76 | 77 | 78 | ## v2 79 | 2017-11-19 80 | 81 | * Fix pattern matching if package is given 82 | * Allow specifying package as a regular expression 83 | 84 | 85 | ## v1 86 | 2017-11-18 87 | 88 | * Initial Release 89 | -------------------------------------------------------------------------------- /archlinux-java-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # (c) 2017, 2018, 2019, 2020, 2023, 2024 Michael Lass 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in all 14 | # copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | # SOFTWARE. 23 | # 24 | 25 | # This script uses `exec` on purpose to launch a suitable JRE before the end of 26 | # the script. 27 | # shellcheck disable=SC2093 28 | VERSION=11 29 | JAVADIR=###JAVADIR### 30 | 31 | JAVAFX_MODULES=javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web 32 | 33 | function print_usage { 34 | cat << EOF 35 | 36 | USAGE: 37 | archlinux-java-run [-a|--min MIN] [-b|--max MAX] [-p|--package PKG] 38 | [-f|--feature FEATURE] [-h|--help] [-v|--verbose] 39 | [-d|--dry-run] [-j|--java-home] 40 | -- JAVA_ARGS 41 | 42 | EOF 43 | } 44 | 45 | function print_help { 46 | cat << EOF 47 | 48 | archlinux-java-run, Version v$VERSION 49 | 50 | archlinux-java-run is a helper script used to launch Java applications 51 | that have specific demands on version or provider of the used JVM. 52 | Options can be arbitrarily combined and archlinux-java-run will try to 53 | find a suitable version. If the user's default JVM is eligible, it will 54 | be used. Otherwise, if multiple eligible versions are installed, the 55 | newest Java generation is used. If multiple packages are available for 56 | this version, the one corresponding to the user's default JVM is used. 57 | 58 | By default, archlinux-java-run will execute a suitable version of java 59 | with the given JAVA_ARGS. When run with -j|--java-home, it just prints 60 | the location of a suitable java installation so that custom commands 61 | can be run. 62 | EOF 63 | print_usage 64 | cat << EOF 65 | AVAILABLE FEATURES: 66 | javafx: Test if JVM provides support for JavaFX. For JVM versions above 8 67 | this will modify the module path and the list of loaded modules to 68 | make JavaFX available. CAUTION: Software developed for Java >8 using 69 | JavaFX typically provides and loads its own copy of OpenJFX. The 70 | feature should not be requested in this case. 71 | 72 | jdk: Test if the installation is a full JDK and not just a JRE, i.e., it 73 | includes javac. 74 | 75 | EXAMPLES: 76 | archlinux-java-run --max 8 -- -jar /path/to/application.jar 77 | (launches java in version 8 or below) 78 | 79 | archlinux-java-run --package 'jre/jre|jdk' -- -jar /path/to/application.jar 80 | (launches Oracle's java from one of the jre or jdk AUR packages) 81 | 82 | archlinux-java-run --feature 'javafx' -- -jar /path/to/application.jar 83 | (launches a JVM that supports JavaFX) 84 | 85 | JAVA_HOME=\$(archlinux-java-run --min 11 --feature jdk --java-home) \\ 86 | && "\$JAVA_HOME"/bin/javac ... 87 | (launches javac from a JDK in version 11 or newer) 88 | 89 | EOF 90 | } 91 | 92 | function echo_stderr { 93 | echo "$1" 1>&2 94 | } 95 | 96 | function is_in { 97 | [[ "$1" =~ (^| )"$2"($| ) ]] 98 | } 99 | 100 | function normalize_name { 101 | re_default="^java-([0-9]+)-(.+)\$" 102 | re_short="^(.+)-([0-9]+)\$" 103 | re_split="^([-A-Za-z]*[A-Za-z]+)-?([0-9]+)-(.+)\$" 104 | if [[ $1 =~ $re_default ]]; then 105 | echo -n "$1" 106 | elif [[ $1 =~ $re_short ]]; then 107 | echo -n "java-${BASH_REMATCH[2]}-${BASH_REMATCH[1]}" 108 | elif [[ $1 =~ $re_split ]]; then 109 | echo -n "java-${BASH_REMATCH[2]}-${BASH_REMATCH[1]}-${BASH_REMATCH[3]}" 110 | else 111 | echo_stderr "ERROR: Could not parse JRE name $1" 112 | fi 113 | } 114 | 115 | available=$(archlinux-java status | tail -n+2 | cut -d' ' -f3 | sort -rV -t- -k2 | xargs) 116 | default=$(archlinux-java get) 117 | 118 | if [ -z "$default" ]; then 119 | echo_stderr "Your Java installation is not set up correctly. Try archlinux-java fix." 120 | exit 1 121 | fi 122 | 123 | # Default boundaries for Java versions 124 | min=-1 125 | max=-1 126 | for ver in $available; do 127 | major=$(normalize_name "$ver" | cut -d- -f2) 128 | if [ "$major" -gt "$max" ]; then 129 | max="$major" 130 | fi 131 | if [ "$major" -lt "$min" ] || [ "$min" -eq -1 ]; then 132 | min="$major" 133 | fi 134 | done 135 | 136 | function generate_candiates { 137 | local list 138 | local pref_package 139 | pref_package=$(cut -d- -f3- <<< "$(normalize_name "$default")") 140 | 141 | local exp 142 | exp="($(seq "$min" "$max"|paste -sd'|'))" 143 | if [ -n "$package" ]; then 144 | exp="^java-${exp}-(${package})\$" 145 | else 146 | exp="^java-${exp}-.*\$" 147 | fi 148 | 149 | # we want to try the user's default JRE first 150 | if [[ $(normalize_name "$default") =~ $exp ]]; then 151 | list="$default " 152 | fi 153 | 154 | local subexp 155 | for i in $(seq "$max" -1 "$min"); do 156 | 157 | # try JRE that matches the user's default package 158 | subexp="^java-${i}-${pref_package}\$" 159 | for ver in $available; do 160 | norm_ver=$(normalize_name "$ver") 161 | if [[ $norm_ver =~ $exp && $norm_ver =~ $subexp ]]; then 162 | if ! is_in "$list" "$ver"; then 163 | list="$list$ver " 164 | fi 165 | fi 166 | done 167 | 168 | # try openjdk since it is Arch's default 169 | subexp="^java-${i}-openjdk\$" 170 | for ver in $available; do 171 | norm_ver=$(normalize_name "$ver") 172 | if [[ $norm_ver =~ $exp && $norm_ver =~ $subexp ]]; then 173 | if ! is_in "$list" "$ver"; then 174 | list="$list$ver " 175 | fi 176 | fi 177 | done 178 | 179 | # try everything else 180 | for ver in $available; do 181 | norm_ver=$(normalize_name "$ver") 182 | if [[ $norm_ver =~ $exp ]]; then 183 | if ! is_in "$list" "$ver"; then 184 | list="$list$ver " 185 | fi 186 | fi 187 | done 188 | 189 | done 190 | 191 | echo "$list" | xargs 192 | } 193 | 194 | function test_javafx_support() { 195 | if [ "$major" -lt 9 ]; then 196 | testcmd="/usr/lib/jvm/${ver}/bin/java -jar ${JAVADIR}/archlinux-java-run/TestJavaFX.jar" 197 | else 198 | mpath=$(eval echo "/usr/lib/jvm/{${ver},java-${major}-openjfx}/lib/{javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web,javafx-swt}.jar" | tr ' ' :) 199 | testcmd="/usr/lib/jvm/${ver}/bin/java --module-path ${mpath} --add-modules ALL-MODULE-PATH -jar ${JAVADIR}/archlinux-java-run/TestJavaFX.jar" 200 | fi 201 | if [ "$verbose" -eq 1 ]; then 202 | echo_stderr "Testing JavaFX support: $testcmd" 203 | fi 204 | $testcmd 205 | } 206 | 207 | function test_jdk_support() { 208 | test -x /usr/lib/jvm/"$ver"/bin/javac 209 | } 210 | 211 | function extend_java_args() { 212 | local updated=0 213 | for i in "${!java_args[@]}"; do 214 | case "${java_args[i]}" in 215 | --"$1"=*) 216 | java_args[i]="${java_args[i]}$3$2" 217 | updated=1 218 | ;; 219 | --"$1") 220 | java_args[i+1]="${java_args[i+1]}$3$2" 221 | updated=1 222 | ;; 223 | esac 224 | done 225 | if [ $updated -eq 0 ]; then 226 | java_args=("--$1=$2" "${java_args[@]}") 227 | fi 228 | } 229 | 230 | function quote_args() { 231 | for arg in "${java_args[@]}"; do 232 | if [[ $arg =~ " " ]]; then 233 | quoted_java_args+=("${arg@Q}") 234 | else 235 | quoted_java_args+=("${arg}") 236 | fi 237 | done 238 | } 239 | 240 | args=( ) 241 | for arg; do 242 | case "$arg" in 243 | --min) args+=( -a ) ;; 244 | --max) args+=( -b ) ;; 245 | --help) args+=( -h ) ;; 246 | --package) args+=( -p ) ;; 247 | --feature) args+=( -f ) ;; 248 | --verbose) args+=( -v ) ;; 249 | --dry-run) args+=( -d ) ;; 250 | --java-home) args+=( -j ) ;; 251 | *) args+=( "$arg" ) ;; 252 | esac 253 | done 254 | set -- "${args[@]}" 255 | features=( ) 256 | java_args=( ) 257 | quoted_java_args=( ) 258 | verbose=0 259 | dryrun=0 260 | javahome=0 261 | args_parsed=0 262 | while :; do 263 | if [ $args_parsed -eq 0 ]; then 264 | case "$1" in 265 | -a) case "$2" in 266 | ''|*[!0-9]*) echo_stderr "-a|--min expects an integer argument" 267 | exit 1 268 | ;; 269 | *) min=$2 270 | shift 271 | ;; 272 | esac 273 | ;; 274 | -b) case "$2" in 275 | ''|*[!0-9]*) echo_stderr "-b|--max expects an integer argument" 276 | exit 1 277 | ;; 278 | *) max=$2 279 | shift 280 | ;; 281 | esac 282 | ;; 283 | -h) print_help 284 | exit 0 285 | ;; 286 | -p) case "$2" in 287 | ''|-*|*' '*) echo_stderr "-p|--package expects exactly one argument" 288 | exit 1 289 | ;; 290 | *) package=$2 291 | shift 292 | ;; 293 | esac 294 | ;; 295 | -f) case "$2" in 296 | ''|-*|*' '*) echo_stderr "-f|--feature expects exactly one argument" 297 | exit 1 298 | ;; 299 | *) features+=( "$2" ) 300 | shift 301 | ;; 302 | esac 303 | ;; 304 | -v) verbose=1 305 | ;; 306 | -d) dryrun=1 307 | ;; 308 | -j) javahome=1 309 | ;; 310 | --) args_parsed=1 311 | ;; 312 | '') break 313 | ;; 314 | *) echo_stderr "Unknown argument: $1" 315 | print_usage 1>&2 316 | exit 1 317 | ;; 318 | esac 319 | else 320 | [ "$1" == '' ] && break 321 | java_args+=("$1") 322 | fi 323 | shift 324 | done 325 | 326 | candidates=$(generate_candiates) 327 | 328 | for ver in $candidates; do 329 | 330 | major=$(normalize_name "$ver" | cut -d- -f2) 331 | 332 | # Test for each of the required features 333 | for ft in "${features[@]}"; do 334 | case "$ft" in 335 | jdk) 336 | if ! test_jdk_support; then 337 | continue 2 338 | fi 339 | ;; 340 | javafx) 341 | if ! test_javafx_support; then 342 | continue 2 343 | fi 344 | ;; 345 | *) 346 | echo_stderr "Ignoring request for unknown feature $ft" 347 | ;; 348 | esac 349 | done 350 | 351 | if [ $javahome -eq 1 ]; then 352 | echo "/usr/lib/jvm/${ver}" 353 | exit 0 354 | fi 355 | 356 | for ft in "${features[@]}"; do 357 | case "$ft" in 358 | javafx) 359 | if [ "$major" -gt 8 ]; then 360 | echo_stderr "Modifying java arguments to support system installation of JavaFX" 361 | additional_mpath=$(eval echo "/usr/lib/jvm/{${ver},java-${major}-openjfx}/lib/{javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web,javafx-swt}.jar" | tr ' ' :) 362 | extend_java_args module-path "$additional_mpath" ':' 363 | extend_java_args add-modules "$JAVAFX_MODULES" ',' 364 | fi 365 | ;; 366 | esac 367 | done 368 | 369 | quote_args 370 | 371 | if [ $dryrun -eq 1 ]; then 372 | echo "DRY-RUN - Generated command: /usr/lib/jvm/${ver}/bin/java ${quoted_java_args[*]}" 373 | exit 0 374 | fi 375 | 376 | if [ $verbose -eq 1 ]; then 377 | echo_stderr "Executing command: /usr/lib/jvm/${ver}/bin/java ${quoted_java_args[*]}" 378 | fi 379 | 380 | exec /usr/lib/jvm/"$ver"/bin/java "${java_args[@]}" 381 | 382 | done 383 | 384 | echo_stderr "No suitable JVM found." 385 | echo_stderr "Available: $available" 386 | echo_stderr "Default: $default" 387 | echo_stderr "Min. required: $min" 388 | echo_stderr "Max. required: $max" 389 | echo_stderr "Package required: $package" 390 | echo_stderr "Candidates: $candidates" 391 | echo_stderr "Features required: ${features[*]}" 392 | exit 1 393 | --------------------------------------------------------------------------------