Sign in Join
Wiki copytemporary

FPC JVM: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: FPC JVM

OldNewLine
1+## Overview
2+
3+The FPC backend for the Java Virtual Machine (JVM) generates Java byte code that conforms to the specifications of the **JDK 1.5 (and later)**, and also to the Dalvik VM from the **Android** platform. While not all FPC language features work when targeting the JVM, most do (or will in the future) and we have done our best to introduce as few differences as possible.
4+
5+## Detailed information
6+
7+- [[FPC JVM/Usage|Basic usage information]]
8+- [[FPC JVM/Language|Supported language constructs and other programming information]]
9+- [[FPC JVM/Debugging|Help with debugging the Java class files]]
10+- [[FPC JVM/Building|Building the compiler and Java utilities from source]]
11+- [[FPC JVM/Internals|Information about internal changes to the compiler and RTL]] (mainly interesting to compiler/RTL developers)
12+
13+## Download
14+
15+Please check the official [download page](http://www.freepascal.org/download.var) for your platform to see whether a pre-built release of the JVM cross-compiler is available.
16+
17+If your platform is not listed above, or if you are only interested in building the compiler/RTL from source, a separate archive that only contains the compiled Java components (Jasmin, javapp, BCEL) is also available. Building instructions for the compiler and are available via the "Building" link above.
18+
19+- [FPC JVM utilities](ftp://ftp.freepascal.org/pub/fpc/contrib/jvm/fpcjvmutilities.zip) (you do **not** need this if you already downloaded an official release)
20+
21+## Quick start
22+
23+### Java or Android
24+
25+By default, the compiler will generate code suitable for running on a Java Virtual Machine. If you wish to create Java class files that can be translated using the Android SDK into Dalvik code, add the *-Tandroid* compiler command line parameter.
26+
27+For more detailed information about the development of apps for Android see [[FPC JVM Android Development|here]].
28+
29+### Compile a test program
30+
31+The used example is <https://gitlab.com/freepascal.org/fpc/source/-/blob/main/tests/test/jvm/trange1.pp>
32+
33+` ppcjvm -O2 -g trange1`
34+
35+### Run it on Windows
36+
37+*Note: the path to the units has changed since the previous snapshots!*
38+
39+` java -cp C:\full\path\to\fpcjvm\units\jvm-java\rtl;. trange1`
40+
41+Replace *C:\full\path\to\fpcjvm\units\jvm-java\rtl* with the full path to the *units\jvm-java\rtl* directory from the snapshot archive.
42+
43+### Run it on Unix-like platforms
44+
45+*Note: the path to the units has changed since the previous snapshots!*
46+
47+` java -cp /full/path/to/fpcjvm/units/jvm-java/rtl:. trange1`
48+
49+Replace */full/path/to/fpcjvm/units/jvm-java/rtl* with the full path to the *units/jvm-java/rtl* directory from the snapshot archive.
50+
51+### More details
52+
53+See the [[FPC JVM/Usage|usage information]] page for more details.
54+
55+## See also
56+
57+- [[Lazarus JVM]] Using Lazarus to build Java applications.
58+
59+---
60+*From the Free Pascal wiki, page "FPC JVM", as it stood on 2023-01-21 after a change by Peter.Dell, 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](/wiki-contact).*
61+Category: FPC
62+Category: JVM

Back to history