Sign in Join
Wiki copytemporary

FPC JVM: what changed

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

OldNewLine
11## Overview
22
33The 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.
44
55## Detailed information
66
77- [[FPC JVM/Usage|Basic usage information]]
88- [[FPC JVM/Language|Supported language constructs and other programming information]]
99- [[FPC JVM/Debugging|Help with debugging the Java class files]]
1010- [[FPC JVM/Building|Building the compiler and Java utilities from source]]
1111- [[FPC JVM/Internals|Information about internal changes to the compiler and RTL]] (mainly interesting to compiler/RTL developers)
1212
1313## Download
1414
1515Please 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.
1616
1717If 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.
1818
1919- [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)
2020
2121## Quick start
2222
2323### Java or Android
2424
2525By 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.
2626
2727For more detailed information about the development of apps for Android see [[FPC JVM Android Development|here]].
2828
2929### Compile a test program
3030
3131The used example is <https://gitlab.com/freepascal.org/fpc/source/-/blob/main/tests/test/jvm/trange1.pp>
3232
33-` ppcjvm -O2 -g trange1`
33+```text
34+ ppcjvm -O2 -g trange1
35+```
3436
3537### Run it on Windows
3638
3739*Note: the path to the units has changed since the previous snapshots!*
3840
39-` java -cp C:\full\path\to\fpcjvm\units\jvm-java\rtl;. trange1`
41+```text
42+ java -cp C:\full\path\to\fpcjvm\units\jvm-java\rtl;. trange1
43+```
4044
4145Replace *C:\full\path\to\fpcjvm\units\jvm-java\rtl* with the full path to the *units\jvm-java\rtl* directory from the snapshot archive.
4246
4347### Run it on Unix-like platforms
4448
4549*Note: the path to the units has changed since the previous snapshots!*
4650
47-` java -cp /full/path/to/fpcjvm/units/jvm-java/rtl:. trange1`
51+```text
52+ java -cp /full/path/to/fpcjvm/units/jvm-java/rtl:. trange1
53+```
4854
4955Replace */full/path/to/fpcjvm/units/jvm-java/rtl* with the full path to the *units/jvm-java/rtl* directory from the snapshot archive.
5056
5157### More details
5258
5359See the [[FPC JVM/Usage|usage information]] page for more details.
5460
5561## See also
5662
5763- [[Lazarus JVM]] Using Lazarus to build Java applications.
5864
5965---
6066*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).*
6167Category: FPC
6268Category: JVM

Back to history