High-performance, memory-safe packaging engine written in Rust that converts Java Archive (.jar) files into native Windows (.exe), Linux (.elf), and macOS (.app) executables with universal multi-language bindings.
The JPEF core is built from scratch in Rust for safety, zero-overhead performance, and fearless concurrency. It compiles simultaneously as:
- A standalone high-speed CLI tool (
jpef/jpef.exe). - A universal C-ABI dynamic shared library (
jpef.dll/libjpef.so/libjpef.dylib).
This design provides first-class, idiomatic SDK bindings for every major programming environment:
| Language | Integration Type | Location |
|---|---|---|
| π¦ Rust | Native Crates & CLI (cargo add jpef) |
src/ |
| π¨ C | Pure C99/C11 Header API | bindings/c/include/jpef.h |
| β C++ | Modern C++17/C++20 RAII Wrapper | bindings/cpp/include/jpef.hpp |
| π TypeScript & JS | Fast Koffi FFI wrapper + .d.ts types for Node.js, Bun & Deno |
bindings/typescript/ |
| π· C# / .NET | High-performance P/Invoke bindings for .NET 8 / 9 / 10 | bindings/csharp/ |
| πΉ Go | Pure Go zero-dependency bindings (syscall.NewLazyDLL) |
bindings/go/ |
| π Python | Native ctypes wrapper with type hints |
bindings/python/ |
| β Java | Java 21+ Foreign Function & Memory API (Project Panama) | bindings/java/ |
cargo build --releaseCompiled binaries:
target/release/jpef.exe(Standalone CLI)target/release/jpef.dll(C-ABI Shared Library)
Analyzes the JAR manifest, detects Main-Class, scans bytecode versions, and checks dependencies:
./target/release/jpef inspect MyApp.jarCross-compile a .jar into standalone native executables for all platforms:
./target/release/jpef convert MyApp.jar -t exe,elf,app -o dist/ --icon logo.png./target/release/jpef convert MyApp.jar -t exe,elf,app -o dist/ \
--name "SuperApp" \
--console \
--min-heap 256m \
--max-heap 2048m \
--jvm-arg "-Dfile.encoding=UTF-8"#include "jpef.h"
#include <stdio.h>
int main() {
JpefConfig *cfg = jpef_config_new();
jpef_config_set_jar_path(cfg, "MyApp.jar");
jpef_config_set_output_dir(cfg, "dist");
jpef_config_set_targets(cfg, JPEF_TARGET_ALL);
JpefResult *res = jpef_convert(cfg);
if (jpef_result_is_success(res)) {
printf("Conversion succeeded! Produced %zu artifacts.\n", jpef_result_get_artifact_count(res));
}
jpef_result_free(res);
jpef_config_free(cfg);
return 0;
}Compile:
gcc -Ibindings/c/include bindings/c/example.c target/release/jpef.dll -o example_c.exe#include "jpef.hpp"
#include <iostream>
int main() {
auto config = jpef::BuildConfig()
.set_jar_path("MyApp.jar")
.set_output_dir("dist")
.set_app_name("CoolApp")
.set_targets(jpef::Target::All);
auto result = jpef::convert(config);
if (result.is_success()) {
for (const auto &art : result.artifacts()) {
std::cout << art.platform << ": " << art.path << "\n";
}
}
return 0;
}Compile:
g++ -std=c++17 -static-libgcc -static-libstdc++ -Ibindings/c/include -Ibindings/cpp/include bindings/cpp/example.cpp target/release/jpef.dll -o example_cpp.exeimport jpef from './bindings/typescript';
// Inspect JAR metadata
const info = jpef.inspect("MyApp.jar");
console.log(`Main-Class: ${info.mainClass}, Min Java Version: ${info.minJavaVersion}`);
// Convert to native executables
const result = jpef.convert({
jarPath: "MyApp.jar",
outputDir: "dist",
appName: "SuperApp",
targets: ["exe", "elf", "app"],
isGui: true,
minHeap: "256m",
maxHeap: "1024m"
});
console.log(`Successfully generated ${result.artifacts.length} platform binaries.`);Run:
node bindings/typescript/example.jsusing Jpef;
var result = JpefClient.Convert(
jarPath: "MyApp.jar",
outputDir: "dist",
appName: "DotNetApp",
targets: TargetPlatform.All,
isGui: true
);
if (result.Success) {
foreach (var art in result.Artifacts) {
Console.WriteLine($"{art.Platform}: {art.Path}");
}
}Run:
dotnet run --project bindings/csharp/JpefApp.csprojpackage main
import (
"fmt"
jpef "."
)
func main() {
res, err := jpef.Convert(jpef.ConvertOptions{
JarPath: "MyApp.jar",
OutputDir: "dist",
AppName: "GoApp",
Targets: jpef.TargetAll,
})
if err == nil && res.Success {
for _, art := range res.Artifacts {
fmt.Printf("%s: %s\n", art.Platform, art.Path)
}
}
}Run:
go run .import jpef_rs
# Inspect JAR file
info = jpef_rs.inspect("MyApp.jar")
print(f"Main-Class: {info.main_class}, Java Requirement: {info.min_java_version}+")
# Convert to native binaries
res = jpef_rs.convert(
jar_path="MyApp.jar",
output_dir="dist",
app_name="PyApp",
targets=["exe", "elf", "app"]
)
print(f"Generated {len(res.artifacts)} native executables successfully.")Run:
python bindings/python/example.pyimport jpef.Jpef;
import java.util.List;
public class Main {
public static void main(String[] args) {
Jpef.ConvertResult res = Jpef.convert(
"MyApp.jar",
"dist",
"JavaApp",
true,
List.of("-Dfile.encoding=UTF-8")
);
System.out.println("Status: " + res.success());
}
}Compile & Run (Java 21+ Foreign Function API):
javac --enable-preview --source 21 bindings/java/jpef/Jpef.java bindings/java/Example.java
java --enable-preview --enable-native-access=ALL-UNNAMED -cp bindings/java Examplecargo testEach language directory includes an automated test runner and verification suite confirming FFI stability with jpef.dll / libjpef.so.
Contributions, bug reports, and optimizations are welcome! Licensed under the MIT License.
Crafted by omerdev (@bruhgit)