Call a Fortran dynamic library (DLL) from Java bean by using JNI/JNA.
This demo is allowing the invocation of one or many DLL. JNI, Java Native Interface, is giving access to the C++ code which is encapsulating the Fortran code. As a test, two parameters (XML files) are sent through the FortranExecuter class to the FortranExecuter.dll library. In return, a message is sent back from the library to the java code.
To achieve the operation, the library FortranExecuter.dll should be call by the fortrandll1.dll library.
- Parameters sent by the
FortranExecutor.class- [IN] (
string) :'c:\processor\incoming\in.xml' - [IN] (
string) :'c:\processor\outcoming\out.xml' - [OUT] (
integer) :100(value code 'no error' sent back from the library)
- [IN] (
- DLL files
FortranExecuter.dllinterface that allows to invokensub-DLL(s)fortrandll1.dllcalled byFortranExecuter.dlland which is containing the Fortran code
To test the application,
- Go to the
'\bin'folder - Copy the
FortranExecuter.dllDLL to this place :'C:\FortranExecuter.dll' - Start
run.bat
Note, as a test an OK message code (100) should be returned by the library.
You might need a few things for your environment (PATH) such as,
- Java JDK 8
- Compilers,
- Gnu gfortran (MinGW)
- Gnu g++ (MinGW)
Copyright (C) 2023, John Van Derton
Please read the 'LICENCE' file for more information.
Feel free to support, thanks!
BTC, bc1q84seqrs0tvzy22gekx3u98xf92ujxvju0jsqrl
