I am working on getting the tool JNI4NET working so that I can use some Java code I have within my C# application. As a simple initial test I have created a simple Java class library with a single class Person
with one method public String GetName() { return "NoBody"; }
. From here I have been following along with the samples given in the JNI download to edit the generateProxies.cmd
to create the DLL wrapper of the jar.
I didn't have much luck with this so I decided to try to perform the same action but with the sample, specifically the sample entitled myJavaDemoCalc
. When executed generateProxies.cmd
in the sample folder an error is thrown.
(I will transcribe this picture if need be)
I have followed the link in the exception though while I somewhat understand what it means I am not sure if it is necessarily safe to enable loading from remote sources as it suggests at the end of the linked article.
I am also confused why the exception is being thrown seeing that the generateProxies.cmd
and thus ProxyGen.exe is being run from my C:
drive.
Anyone have an idea of what I could try next or know the issue here?
For reference here is the generateProxies.cmd
source from myJavaDemoCalc
@echo off
copy ..\..\lib\*.* work
..\..\bin\proxygen.exe work\myJavaDemoCalc.jar -wd work
cd work
call build.cmd
cd ..
echo compiling usage
csc.exe /nologo /warn:0 /reference:work\jni4net.n-0.8.8.0.dll /reference:work\myJavaDemoCalc.j4n.dll /out:work\demo.exe /target:exe MyCalcUsageInDotnet.cs