Lazarus JVM: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | With the recent publishing of [[FPC JVM|FPC JVM branch]] it's now possible to build java applications. | |
| 2 | 2 | ||
| 3 | 3 | Lazarus doesn't provide any special features to support the JVM target, however you can already configure IDE to start development. | |
| 4 | 4 | ||
| 5 | 5 | 1\) Change the compiler path in Options to the JVM compiler, (i.e. in Windows, assuming the snapshot was unpacked to c:\fpcjvm directory) | |
| 6 | 6 | ||
| 7 | - | ||
| 7 | + | ```text | |
| 8 | + | C:\fpcjvm\bin\ppcjvm.exe | |
| 9 | + | ``` | |
| 8 | 10 | ||
| 9 | 11 | 2\) You should use only use **-g** and **-O2** in the project's compiler options; | |
| 10 | 12 | ||
| 11 | 13 | This should be enough for you to compile the project in Lazarus. | |
| 12 | 14 | ||
| 13 | 15 | To run the application from the IDE you need to do the following: | |
| 14 | 16 | ||
| 15 | 17 | 3\) The compiled file is .class file, so it cannot be run as a normal executable. You'll need to configure the "Host Application" at Run-\>Run parameters menu. | |
| 16 | 18 | ||
| 17 | 19 | - for the host application you need to specify *java* application installed in the system with Java Runtime | |
| 18 | 20 | - for the parameters you'll need to specify -cp (class path) parameter (refer) and the built file name (without .class extension). -cp parameter must include the full path of the JVM RTL library, and the path to the compiled project files; | |
| 19 | 21 | ||
| 20 | 22 | Example to run the example *trange1* test application. | |
| 21 | 23 | ||
| 22 | 24 |  | |
| 23 | 25 | ||
| 24 | 26 | For more details of configuration *java* you can refer to [[FPC JVM/Usage|FPC JVM Usage page]] | |
| 25 | 27 | ||
| 26 | 28 | There's no Java debugger support in Lazarus at the moment. | |
| 27 | 29 | ||
| 28 | 30 | --- | |
| 29 | 31 | *From the Free Pascal wiki, page "Lazarus JVM", as it stood on 2013-09-22 after a change by Jwdietrich, 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).* | |
| 30 | 32 | Category: JVM | |
| 31 | 33 | Category: Lazarus |
