The Configure.pl script manages configuration settings and dependencies for PerlOnJava.
./Configure.pl [options]
./Configure.pl -D key=value
./Configure.pl --search keyword
./Configure.pl --direct group:artifact:version
./Configure.pl --upgradeRun the script directly from the repository root. Its shebang selects the system Perl, and its required Perl modules are listed at the top of the script.
Configure.pl does not toggle Perl thread support. The bundled Perl Config
module reports the shipped runtime capabilities directly:
| Key | Value | Meaning |
|---|---|---|
useithreads |
define |
Snapshot-based Perl interpreter threads are available. |
usethreads |
define |
The supported Perl thread API is enabled. |
usemultiplicity |
define |
Independent PerlRuntime instances are supported in one JVM. |
Java 24 virtual threads are the launcher default. The platform executor remains
available process-wide with JPERL_THREAD_MODE=platform or the JVM property
-Djperl.thread.mode=platform. Unknown values are rejected. See
CLI Options, the
Perl threads reference, and the
feature matrix.
Runtime pooling is independently opt-in. JPERL_RUNTIME_POOL_SIZE=N (or
-Djperl.runtime.pool.size=N) enables N prepared PSGI application snapshots;
the default 0 retains the single-runtime handler.
-h, --help
- Show help message and usage instructions
./Configure.pl --help-D key=value
- Set the project version in
Configuration.java.in - String values are automatically quoted
./Configure.pl -D version=5.44.0Special behavior for version:
- Automatically updates all references to the JAR filename throughout the repository
- Updates from
perlonjava-OLD.jartoperlonjava-NEW.jarin all text files
View current configuration:
./Configure.pl--search keyword
- Search Maven Central for artifacts by keyword, class name, or group:artifact
- Interactive selection if multiple matches found
- Useful for finding JDBC drivers and other libraries
# Search by keyword
./Configure.pl --search mysql
./Configure.pl --search postgresql
# Search by driver class name
./Configure.pl --search com.mysql.cj.jdbc.Driver
./Configure.pl --search org.postgresql.Driver
# Search by group:artifact
./Configure.pl --search org.postgresql:postgresqlSearch behavior:
- Class names (ending in
.Driver): Searches by fully qualified class name - Keywords with
:: Searches bygroup:artifactpattern - Other keywords: Searches in artifact name and text fields
- Returns top 10 most relevant results ranked by JDBC relevance
- Prompts for selection if multiple matches found
--direct group:artifact:version
- Add dependency using direct Maven coordinates
- No search required - immediately updates build files
- Format must be:
group:artifact:version
./Configure.pl --direct com.mysql:mysql-connector-j:8.2.0
./Configure.pl --direct org.postgresql:postgresql:42.7.1--verbose
- Enable verbose output for debugging
- Shows Maven Central API URLs
- Displays full search results as JSON
- Useful for troubleshooting search issues
./Configure.pl --search mysql --verbose--upgrade
- Upgrade all project dependencies to their latest versions
- Updates both Maven (
pom.xml) and Gradle (build.gradle) dependencies - Uses
mvn versions:use-latest-versionsfor Maven - Uses
./gradlew versionCatalogUpdatefor Gradle
./Configure.pl --upgradeRequirements:
- Maven must be installed for Maven upgrades
- Gradle wrapper must be present for Gradle upgrades
Recommended workflow:
- Search for the driver:
./Configure.pl --search mysql-connector-java- Or use direct coordinates if you know them:
./Configure.pl --direct com.mysql:mysql-connector-j:8.2.0- Rebuild the project to include the driver:
makeThe driver is now bundled in the PerlOnJava JAR.
Alternative: Manual CLASSPATH
Instead of bundling drivers, you can load them at runtime:
# Download driver manually
wget https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/8.2.0/mysql-connector-j-8.2.0.jar
# Use with CLASSPATH
CLASSPATH=/path/to/mysql-connector-j-8.2.0.jar ./jperl script.plWhen you add a dependency with --search or --direct:
-
Updates
build.gradle(if present):- Adds
implementation "group:artifact:version"to dependencies block
- Adds
-
Updates
pom.xml(if present):- Adds
<dependency>entry with groupId, artifactId, version
- Adds
-
Requires rebuild:
- Run
maketo download, bundle, and test the dependency
- Run
The Maven Central search ranks results by JDBC relevance:
- +5 points:
jdbcin group or artifact name - +4 points: Class name ends with
Driver - +3 points: Database keywords (mysql, postgresql, oracle, sqlserver, database)
- +2 points:
jdbcin version - Bonus: Logarithm of download count
This ensures JDBC drivers appear first in search results.
When you set configuration with -D:
- Reads
src/main/java/org/perlonjava/core/Configuration.java.in - Finds
public static final Type key = value;declarations - Replaces value with new value
- Writes updated file back
For version updates, also:
- Scans all text files in the repository
- Replaces old JAR filename with new one
- Skips binary files and hidden directories
./Configure.plOutput:
Current configuration:
version = "5.44.0"
./Configure.pl -D version=5.44.0# Search for PostgreSQL driver
./Configure.pl --search postgresql
# Output shows:
# Multiple matches found:
# [0] org.postgresql:postgresql:42.7.1
# [1] com.impossibl.pgjdbc-ng:pgjdbc-ng:0.8.9
# [2] ...
# Select number [0-9]: 0
# Updates build.gradle and pom.xml
# Updated build.gradle
# Updated pom.xml
# Rebuild to include driver
make# Add MySQL database driver
./Configure.pl --direct com.mysql:mysql-connector-j:8.2.0
# Rebuild
make./Configure.pl --upgradeOutput:
Upgrading project dependencies to latest versions...
Updating Maven dependencies to latest versions...
Maven dependencies updated successfully.
Updating Gradle dependencies to latest versions using version catalog...
Gradle dependencies updated successfully.
# Option 1: Search and select
./Configure.pl --search mysql
make
# Option 2: Direct coordinates
./Configure.pl --direct com.mysql:mysql-connector-j:8.2.0
make
# Option 3: Manual CLASSPATH (no rebuild needed)
CLASSPATH=/path/to/mysql-connector.jar ./jperl script.pl./Configure.pl -D version=5.44.0
# This updates Configuration.java.in and all references to perlonjava-*.jar# Search by database name
./Configure.pl --search postgresql --verbose
# Search by driver class
./Configure.pl --search org.postgresql.Driver --verboseProblem: ./Configure.pl --search keyword finds nothing
Solutions:
- Try broader keywords:
mysqlinstead ofmysql-connector-java-8.2.0 - Search by driver class:
./Configure.pl --search com.mysql.cj.jdbc.Driver - Use
--verboseto see search URL and results - Use
--directif you know the exact coordinates
Problem: Added dependency with Configure.pl but not available at runtime
Solution: You must rebuild after adding dependencies:
./Configure.pl --direct group:artifact:version
make # This downloads and bundles the dependencyProblem: Multiple versions of same library
Solution: Edit build.gradle or pom.xml manually to resolve conflicts, or use:
./gradlew dependencies # Show dependency tree
mvn dependency:tree # Show Maven dependency tree- Installation Guide - Build and setup
- Database Access Guide - Using JDBC drivers
- CLI Options - jperl command-line options