Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

FPC JVM/Usage

Compiling source code

The name of the compiler binary is ppcjvm (ppcjvm.exe). Compiling source files works the same as on other platforms: ppcjvm <options> name_of_source_file. The most important options are -g (generate debug information) and -O2 (enable optimizations).

Notice that a separate class file will be generated for each non-primitive, non-array type that is defined in a unit or program, and another class for the unit/program itself. Additionally, the names of these classes will correspond exactly to the name of the declarations in the source code. Keep in mind that the JVM and the Java language are case-sensitive.

Finally, if a program does not have a name (because it does not include a program somename; statement), the default name Program will be used for its corresponding class file.

If a module contains a {$namespace xxx} directive, the generated class files for that module will be stored in the directory xxx.

Running compiled programs

The java program is used to run Java class files. There are a number of important command line parameters:

Note that when running a Java program, you have to specify the name of the main class, not of the class file name. This means that you must not specify the .class extension.

Known bugs


From the Free Pascal wiki, page "FPC JVM/Usage", as it stood on 2019-12-22 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .