pas2jni(1)
β¨ pas2jni β¨
okay bestie, gather round, because this one is lowkey iconic π
pas2jni is the Free Pascal Java Native Interface generation tool. that's the whole vibe. it's the little go-between that lets your Pascal code and your Java code finally text each other π
πΈ SYNOPSIS πΈ
pas2jni [options] <unit> [<unit2> <unit3> ...]
so like, what is it actually doing?? it generates a Java native interface description and library from your already-compiled Free Pascal units. not from source, from the compiled units, okay? important β¨
and here's the cute part: for every unit you give it, pas2jni makes 2 files:
- a library that gives you access to all the functions and procedures in that pascal unit, packaged in a way that Java can actually understand π«Ά
- a
.javafile that describes the library, so you can reach into it from Java
it's giving matchmaker. it's giving translator. it's giving "no because why did nobody tell me this existed" π
π OPTIONS π
every single one, no skipping, fr fr π
-U<path>β the unit search path, and it's semicolon delimited. wildcards are allowed in there too, slay β¨-L<name>β sets the output library name. by default it's the name of the unit, followed byjni. so like, unit name plusjni, that's the vibe.-P<name>β sets the Java package name. by default this ispas.-O<path>β sets the output path for the Pascal files. by default it's the current directory.-J<path>β sets the output path for the Java files. by default this ispas.-D<prog>β sets the full path to theppudumpprogram. and yes bestie, you needppudump, because that's the program doing the actual work of analysing what's inside your unit files π§ noppudump, no analysis, no magic.-I<list>β include the list of specified objects in the output. the list is semicolon delimited. wanna read that list from a file instead? use-I@<file>π-E <list>β exclude the list of specified objects from the output. also semicolon delimited. and to read this one from a file, use-E@<file>. yes the space after-Eis there, don't come for me, that's just how it is π«Ά-?β shows a help message. when in doubt, ask the question mark, she always answers π
π EXAMPLES π
okay these are so satisfying, watch this β
this one creates a file pas/getopts.java and a library file getoptsjni.pas unit, straight from the standard getopts unit:
pas2jni units/x86_64-linux/getopts.ppu
and this one creates a file getopts.java and a library file pasgetopts.pas unit, also from the standard getopts unit:
pas2jni -J. -O. -Lpasgetopts -units/x86_64-linux/getopts.ppu
see what happened there?? we told it where to put the Java files (-J.), where to put the Pascal files (-O.), and what to name the library (-Lpasgetopts), and everything landed right where we wanted it. main character energy fr fr π
π¦ SEE ALSO π¦
go hang out with the rest of the squad:
heads up bestie: this page is the Free Pascal tool pas2jni, dated 12 Dec 1999. yes, 1999. she's been serving since before some of us were born and she's still slaying πβ¨ periodt.
π¦ where this page comes from
- arch rolling: fpc 3.2.2-11 Β· GPL AND LGPL AND custom
- epel 10: fpc 3.2.2-20.el10_1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later WITH Independent-modules-exception
- epel 9: fpc 3.2.2-10.el9 Β· GPLv2+ and LGPLv2+ with exceptions
- fedora 43: fpc 3.2.2-20.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later WITH Independent-modules-exception
- fedora 43: fpc 3.2.2-20.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later WITH Independent-modules-exception
- fedora 44: fpc 3.2.4~rc1-3.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later WITH Independent-modules-exception
- fedora 44: fpc 3.2.4~rc1-3.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later WITH Independent-modules-exception
- nixos 26.05: fpc 3.2.2
- nixos 26.05: lazarus-gtk2 4.4-0
- nixos 26.05: lazarus-qt5 4.4-0
- nixos 26.05: lazarus-qt6 4.4-0
- nixpkgs unstable: fpc 3.2.2
- nixpkgs unstable: lazarus-cocoa 4.8-0
- nixpkgs unstable: lazarus-gtk3 4.8-0
- nixpkgs unstable: lazarus-qt5 4.8-0
- nixpkgs unstable: lazarus-qt6 4.8-0
- opensuse-leap 16.0: fpc 3.2.2-bp160.1.35 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: fpc 3.2.2-bp160.1.35 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: fpc 3.2.2-bp160.1.35 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms