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 .java file 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 by jni. so like, unit name plus jni, that's the vibe.
  • -P<name> β€” sets the Java package name. by default this is pas.
  • -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 is pas.
  • -D<prog> β€” sets the full path to the ppudump program. and yes bestie, you need ppudump, because that's the program doing the actual work of analysing what's inside your unit files 🧚 no ppudump, 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 -E is 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