Giter VIP home page Giter VIP logo

archlinux-java-run's Introduction

archlinux-java-run

Java Application Launcher for Arch Linux

archlinux-java-run is a helper script used to launch Java applications that have specific demands on version or provider of the used JVM. Options can be arbitrarily combined and archlinux-java-run will try to find a suitable version. If the user's default JVM is eligible, it will be used. Otherwise, if multiple eligible versions are installed, the newest Java generation is used. If multiple packages are available for this version, the one corresponding to the user's default JVM is used.

By default, archlinux-java-run will execute a suitable version of java with the given JAVA_ARGS. When run with -j|--java-home, it just prints the location of a suitable java installation so that custom commands can be run.

Usage

  archlinux-java-run [-a|--min MIN] [-b|--max MAX] [-p|--package PKG]
                     [-f|--feature FEATURE] [-h|--help] [-v|--verbose]
                     [-d|--dry-run] [-j|--java-home]
                     -- JAVA_ARGS

Available features

  • javafx: Test if JVM provides support for JavaFX. For JVM versions above 8 this will modify the module path and the list of loaded modules to make JavaFX available. CAUTION: Software developed for Java >8 using JavaFX typically provides and loads its own copy of OpenJFX. The feature should not be requested in this case.

  • jdk: Test if the installation is a full JDK and not just a JRE, i.e., it includes javac.

Examples

  • Launch java in version 8 or below: archlinux-java-run --max 8 -- -jar /path/to/application.jar

  • Launch Oracle's java from one of the jre or jdk AUR packages: archlinux-java-run --package 'jre/jre|jdk' -- -jar /path/to/application.jar

  • Launch a JVM that supports JavaFX: archlinux-java-run --feature 'javafx' -- -jar /path/to/application.jar

  • Launch javac from a JDK in version 11 or newer: JAVA_HOME=$(archlinux-java-run --min 11 --feature jdk --java-home) && "$JAVA_HOME"/bin/javac ...

archlinux-java-run's People

Contributors

michaellass avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

archlinux-java-run's Issues

Weird error when

No matter what I call this command with, all I get is:

No suitable JVM found.
Available:         java-run java-home]
Default:           Unknown argument: get

USAGE:
  archlinux-java-run [-a|--min MIN] [-b|--max MAX] [-p|--package PKG]
                     [-f|--feature FEATURE] [-h|--help] [-v|--verbose]
                     [-d|--dry-run] [-j|--java-home]
                     -- JAVA_ARGS
Min. required:     6
Max. required:     20
Package required:  
Candidates:        
Features required: 

Incorrect parsing of spaces in arguments

If I call something like archlinux-java-run -- "arg with space", it will run something like /usr/lib/jvm/java-14-openjdk/bin/java arg with space. Note that the quotes around it disappeared, thus splitting that argument into three.

A good way to find these bugs is pasting the code on https://www.shellcheck.net/, which indeed does report a lot of issues, some potentially related to this issue.

How to handle the JavaFX feature for JRE >9?

Since Java 9, JavaFX is not a part of the SDK anymore. Instead, it's now a separate module. Testing for JavaFX support as it's done currently does not work in this case.

Right now I'm not sure how to handle this case. I guess we will see as soon as some application requires Java >9 with JavaFX support and does not ship openjfx on its own.

"Unknown argument : --jar"

Following the usage instructions, it is asked to use the "--jar" argument, which does not seems to exist (anymore ?).

archlinux-java-run --max 8 --jar ./random_file.jar
Unknown argument: --jar

The "--jar" argument does not appear in the help too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.