Call .NET/C# code from Java

Palle Cogburn · 40K views · 2013 · 36:00

Open on YouTube

C, C++, Rust, Go & systems languagesSoftware architecture & designSoftware practice, open source & careerstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when they need a step-by-step walkthrough for bridging Java to C# DLLs via JNI, a C++ wrapper, or JNI4Net.

Recommended by 1 people across 1 different months, 2014 to 2023.

What it is

A 36-minute tutorial by Palle Cogburn showing how to call .NET/C# code from Java. It covers the standard JNI route with a hand-written C++ proxy, and then the same task using the JNI4Net bridge library.

What people said

Recommends sabby · 2023-03 · Stack Overflow · on “How use function from dll in Java”

You should create your own dll as wrapper over the "C:\Windows\System32\PRx08.dll" as reference to the project. This video will explain how to reference a c# dll into the c++ and call it in java. JNI - Java to C++ and C# [this video] You can add reference to any external dll and create a function wrapper to it and call it from java.

Cites user1254588 · 2014-10 · Stack Overflow · on “System.IO.FileNotFoundException when running Bridge.LoadAndRegisterAssemblyFrom(File arg0) with Jni4net”

I am trying to make a Jni4net program to act as a bridge between a Java database and a C# application. After doing a few of the samples coming with Jni4net I tried following this guide [this video] . After following it thoroughly at the point where his program runs, mine get the error: System.IO.FileNotFoundException I tried different things with the code for a few hours but without progress. Here is the code, I don't think there is anything wrong with my methods and the file TestOne.j4n.dll is indeed under the location FourthTest/TestOne.j4n.dll . It's the method Bridge.LoadAndRegisterAssemblyFrom that's giving me the error. import java.io.File; import java.io.IOException; import net.sf.jni4net.

Cites wiiznokes3 · 2022-11 · Stack Overflow · on “SEHException (0x80004005) when using JNI to run C# code”

Ahah I know it's tricky but I follow this old tuto [this video] so I think it's possible. And it's for this [LINK] library, there is no equivalent in java unfortunately :(