Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access to Java jar from Delphi

Tags:

java

jar

delphi

There's Java jar binary library with described classes/functions making some usefull things (nothing special just plain Java - no JNI). No sources available.

There's a task to call those functions directly from Delphi. How to do that?

P.S. I know nothing about Delphi, but I know a lot about Java.

like image 505
Barmaley Avatar asked Nov 02 '11 05:11

Barmaley


2 Answers

No you can't the way to go is JNI.

A few resources:

  • Pacifiers series on using JNI from Delphi
  • my Talking Java from Delphi talk at the EKON 11 conference
  • the Delphi JNI questions on SO

Unless you have too much time on your hands, in which you could decompress the JAR files (they are ZIP files), write your own Java VM in Delphi and go from there ;-)

like image 51
Jeroen Wiert Pluimers Avatar answered Oct 11 '22 02:10

Jeroen Wiert Pluimers


Does the jar file contains a main class that can be called from the command line? If so problem solved Delphi can execute command line operations. If there is no main class you can create one that calls the original jar file.

like image 21
Peter Szanto Avatar answered Oct 11 '22 02:10

Peter Szanto