- Prerequisites
- Build Options
- Dependencies
- Running PerlOnJava
- Database Integration
- Build Notes
- Java Library Upgrades
- Using Configure.pl
- Java 21 or higher
- Maven or Gradle
- Optional: JDBC drivers for database connectivity
mvn clean package
gradle clean package
- JUnit: For testing
- ASM: For bytecode manipulation
- ICU4J: For Unicode support
- FASTJSON v2: For JSON support
- SnakeYAML Engine: for YAML support
Unix/Linux/Mac:
./jperl -E 'print "Hello World"'
./jperl myscript.pl
CLASSPATH="jdbc-drivers/h2-2.2.224.jar" ./jperl myscript.pl
Windows:
jperl -E "print 'Hello World'"
jperl myscript.pl
set CLASSPATH=jdbc-drivers\h2-2.2.224.jar
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)
use DBI;
my $dbh = DBI->connect("jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1");
$dbh->do("CREATE TABLE test (id INT, name VARCHAR(50))");
See JDBC Database Guide for detailed connection examples and supported databases.
- Maven builds use
maven-shade-plugin
for creating the shaded JAR - Gradle builds use
com.github.johnrengelman.shadow
plugin - Both configurations target Java 21
Maven:
mvn versions:use-latest-versions
.
Gradle:
./gradlew useLatestVersions
.
The Configure.pl
script provides an option to upgrade your project's dependencies to their latest versions. This can be useful for ensuring that your project uses the most up-to-date libraries.
To upgrade dependencies, use the --upgrade
option:
perl ./Configure.pl --upgrade
This command will:
- Update Maven dependencies to their latest versions if a
pom.xml
file is present. - Update Gradle dependencies to their latest versions if a
build.gradle
file is present.
Make sure that Maven and Gradle are installed and accessible in your environment.