- Prerequisites
- Build Options
- Package Installation
- Dependencies
- Running PerlOnJava
- Database Integration
- Build Notes
- Java Library Upgrades
- Using Configure.pl
- Troubleshooting
- JDK 22 or later
- Maven, or the included Gradle wrapper (recommended)
- Optional: JDBC drivers for database connectivity
The project includes a Makefile that wraps Gradle commands for a familiar build experience:
make # same as 'make build'
make build # builds the project and runs unit tests
make test # runs fast unit tests
make clean # cleans build artifacts
make deb # creates a Debian package (Linux only)mvn clean package./gradlew clean buildFor Debian-based systems (Ubuntu, Debian, Mint, etc.), you can create and install a .deb package:
Build the package:
make debThis creates a Debian package in build/distributions/ with:
- PerlOnJava installed under
/opt/perlonjava/ jperl,jcpan,jperldoc, andjprovelinked into/usr/local/bin/- All dependencies bundled
- Systemwide availability
Install the package:
sudo dpkg -i build/distributions/perlonjava_*.debUsage after installation:
# jperl is now available systemwide
jperl -E 'say "Hello World"'
jperl myscript.pl
# No need for ./jperl - it's in your PATHUninstall:
sudo dpkg -r perlonjavaBenefits of Debian package:
- Clean installation and removal
- Systemwide availability (no need for
./jperl) - Automatic dependency tracking
- Integrates with system package manager
- Can be distributed to other Debian-based systems
- JUnit: For testing
- ASM: For bytecode manipulation
- ICU4J: For Unicode support
- SnakeYAML Engine: for YAML support
Unix/Linux/Mac:
./jperl -E 'print "Hello World"'
./jperl myscript.plWindows:
jperl -E "print 'Hello World'"
jperl myscript.pl-I lib: Add library path--debug: Enable debug output--help: Show all options
- Using Configure.pl:
./Configure.pl --search mysql-connector-java- Using Java classpath (shown in platform-specific examples above)
SQLite is bundled with PerlOnJava — no additional installation needed:
use DBI;
my $dbh = DBI->connect("dbi:SQLite:dbname=:memory:", "", "");
$dbh->do("CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT)");For other databases, add JDBC drivers via CLASSPATH or Configure.pl (see below).
See Database Access Guide for detailed connection examples and supported databases.
- Maven builds use
maven-shade-pluginfor creating the shaded JAR - Gradle builds use the Shadow plugin
- Both configurations target Java 22
Maven:
mvn versions:use-latest-versions.
Gradle:
./gradlew useLatestVersions.
The Configure.pl script manages configuration settings and dependencies for PerlOnJava.
Run Configure.pl directly from the repository root. It uses the system Perl
specified by its shebang and requires the Perl modules imported at the top of the
script.
View current configuration:
./Configure.plAdd JDBC driver (search):
./Configure.pl --search mysql
make # Rebuild to include driverAdd JDBC driver (direct):
./Configure.pl --direct com.mysql:mysql-connector-j:8.2.0
make # Rebuild to include driverUpdate configuration:
./Configure.pl -D version=5.44.0Upgrade all dependencies:
./Configure.pl --upgrade-h, --help- Show help message-D key=value- Set configuration value--search keyword- Search Maven Central for artifacts--direct group:artifact:version- Add dependency with Maven coordinates--verbose- Enable verbose output--upgrade- Upgrade dependencies to latest versions
- Rebuild required: After adding dependencies with
--searchor--direct, you must runmaketo download and bundle them - Alternative approach: Instead of bundling drivers, you can use CLASSPATH:
CLASSPATH=/path/to/driver.jar ./jperl script.pl
→ See Configure.pl Reference for complete documentation
Problem: When building with Java 25 or later, you see:
BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 69
> Unsupported class file major version 69
Cause: The build is using an older Gradle installation that cannot run on your JDK.
Solution: Use the repository's Gradle wrapper instead of a system-installed Gradle. Confirm the configured version, then rebuild:
./gradlew --version
make wrapper
make clean
makeOn Windows, use gradlew.bat --version. The wrapper version is defined in
gradle/wrapper/gradle-wrapper.properties; that file is the source of truth.
PerlOnJava compiles for Java 22 and requires JDK 22 or later. Use the included wrapper so the Gradle version stays aligned with the project. For compatibility details beyond the checked-in wrapper, consult Gradle's Java compatibility matrix.
Make sure you have a JDK installed and JAVA_HOME is set:
# Linux/macOS (add to ~/.bashrc or ~/.zshrc)
export JAVA_HOME=/path/to/jdk
# Windows (System Properties > Environment Variables)
set JAVA_HOME=C:\path\to\jdkThe default make target builds the runnable JAR and runs the fast unit suite.
For a targeted test during development, run the relevant .t file with
./jperl, then run make before committing.