-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjperl
More file actions
executable file
·28 lines (22 loc) · 1.01 KB
/
jperl
File metadata and controls
executable file
·28 lines (22 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
#
# PerlOnJava Launcher Script
# This script launches the PerlOnJava runtime environment, which provides
# a Java-based implementation of the Perl programming language.
# Repository: github.com/fglock/PerlOnJava
#
# Get the directory where this script is located, resolving symlinks
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Get the full path to this script to set $^X correctly
JPERL_PATH="$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || echo "$SCRIPT_DIR/jperl")"
# Export environment variable for PerlOnJava to use as $^X
export PERLONJAVA_EXECUTABLE="$JPERL_PATH"
# Check development environment first (target directory)
if [ -f "$SCRIPT_DIR/target/perlonjava-3.0.0.jar" ]; then
JAR_PATH="$SCRIPT_DIR/target/perlonjava-3.0.0.jar"
else
# Use installed package path (when installed via deb package)
JAR_PATH="$SCRIPT_DIR/../lib/perlonjava-3.0.0.jar"
fi
# Launch Java
java --enable-native-access=ALL-UNNAMED ${JPERL_OPTS} -cp "$CLASSPATH:$JAR_PATH" org.perlonjava.app.cli.Main "$@"