Java4Delphi
Creates Delphi .pas files from Java .class files and Java .jar archives so Java classes and libraries can be used from Delphi code.
- uses standard Java Native Interface (JNI)
- uses classes with automatic reference-counting memory management
- supports Delphi 7 - 10.4 and Lazarus 2.0.10
- source code of JNI and Delphi4Java units included in registered version
Example
// Java code: package test; class Test { public Test() { } public String hello() { return "Hello, world!"; } }
// Generated Delphi interface:
type
Itest_Test
=
interface
(
Ijava_lang_Object
)
function
hello
:
string
;
end
;
Ttest_Test
=
class
(
Tjava_lang_Object
,
Itest_Test
)
public
constructor
Create
(
JavaObject
:
JObject
)
;
overload
;
constructor
Create
;
overload
;
end
;
Ttest_TestClass
=
class
(
Tjava_lang_ObjectClass
)
public
property
_initID
:
JMethodID
read
F_initID
;
property
helloID
:
JMethodID
read
FhelloID
;
end
;
function
Get_test_TestClass
:
Ttest_TestClass
;
// Usage:
CreateJavaVM
;
ShowMessage
(
Ttest_Test
.
Create
.
hello
)
;
Download Java4Delphi 1.6 trial version
FAQ
Why JNI_CreateJavaVM throws SEGV exception "$C0000005: read of address 0x00000000" in Delphi IDE?
Ignore this exception, it's generated intentionally in JVM to detect some HW/OS features: Exception 0xC0000005 from JNI_CreateJavaVM
Ignore this exception, it's generated intentionally in JVM to detect some HW/OS features: Exception 0xC0000005 from JNI_CreateJavaVM
Buy at Tokopedia!
Buy Now!Tags: Winsoft Java4Delphi, delphi, c++ builder, GUI/Application Framework library, winsoft, java