Skip to content

About

Universal Linux launcher script for Java applications with automatic JAR and JRE detection.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Universal Java Launcher

A bash script for easy and automated execution of Java applications (.jar) in a Linux environment. The script intelligently searches for executable files and handles the availability of the Java Runtime Environment (JRE).

Features

  • Automatic JAR Detection: The script automatically finds the first .jar file in the dist folder.
  • Java Prioritization:
    1. First, it attempts to use the system-wide Java installation (command -v java).
    2. If system Java is missing, it tries to run the application using a local JRE located in the jre_linux directory.
  • Robust Error Handling: Informs the user if the JAR file or JRE is missing and suggests a solution.

Directory Structure

For the script to function correctly, maintain the following structure:

.
├── universal-java-launcher.sh  # This script
├── dist/                       # Folder containing your .jar file
└── jre_linux/                  # (Optional) Local JRE for Linux

Usage

  1. Ensure the script has execution permissions:
    chmod +x universal-java-launcher.sh
  2. Important: If the script was edited on Windows, fix the line endings before running:
    sed -i 's/\r$//' universal-java-launcher.sh
  3. Run the script:
    ./universal-java-launcher.sh

Resources

Configuration

Variables for modifying paths are located at the beginning of the script:

  • JAVA_DIR: Path to the local JRE.
  • DIST_DIR: Path to the directory with distribution JAR files.

Requirements

  • Linux OS
  • Bash shell
  • Java JRE (System or Local)

About

Universal Linux launcher script for Java applications with automatic JAR and JRE detection.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages