Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Convert Java Class Files and .jar Archive Files into Delphi Modules Using the Java4Delphi Tool

Intro

Java4Delphi converter tool helps to convert Java .class files and Java .jar archives to Delphi .pas files. So, Java classes and libraries can be used from Delphi projects easily.

Java4Delphi by WINSOFT is a commercial tool and gives all the functionalities when you get a license. All the source code of JNI and Delphi4Java units will be included in it.

The best thing about this tool is it utilizes classes with automatic reference-counting memory management.

Currently, this tool is available all the Delphi versions except the latest one Sydney, but be sure to check in near future for a new update.

Specifications

How to use it?

If you would like to learn more about this tool here you can watch the demo action video which shows how to convert Java files into Delphi .pas units.

Java4Delphi in action

To convert Java files, you should use the command-line tool to execute the java4delphi.exe program. Just go to the folder which java4delphi.exe is on and write java4delphi.exe and give the Java file name or path.

CMD

Here is our result:

[crayon-672ace026f077458905017/]

So how we can use this module in our projects? The answer is simple. First, you should call CreateJavaVM before starting to use the converted unit.

Then you can create an instance from the Itest_Test interface:

[crayon-672ace026f081519954819/]

And here is our full implementation and use case:

[crayon-672ace026f085112830074/]

Head over and check out the full WINSOFT Java4Delphi tool!

Like what you see? You can get the Java4Delphi and over 100 other fantastic WinSoft components with our Enterprise Component Pack. For a limited time, when you purchase RAD Studio Enterprise or Architect Edition at special Upgrade Pricing, you will also get this package of third-party software worth over $13,000, including the full WinSoft Component Library, at NO EXTRA COST! Step up to RAD Studio 10.4.1 today!

Exit mobile version