2 Replies Latest reply on Oct 16, 2011 7:44 PM by jschellSomeoneStoleMyAlias

    how to load and call methods of a c# dll in Java application

    894465
      Hello,
      I am using Netbeans and have to write application in java with given c# dll library. The dll is used for communication. I know about java native access..

      I have this problem : "Is it possible to load c# dll in java application. If so how can I load it in my application. Plz help me".


      Thanks for the answers
        • 1. Re: how to load and call methods of a c# dll in Java application
          gimbal2
          891462 wrote:
          I know about java native access..
          and then
          "Is it possible to load c# dll in java application. If so how can I load it in my application. Plz help me".
          You contradict yourself. You claim to know how to do it, yet then you ask how to do it.

          It will have to be either JNI or JNA - I'd research JNA if I were you as its the newer and more preferred way. Also remember this: everything is technically possible, but plenty of technical solutions are actually not good ideas. I wouldn't make decisions based on if something is possible or not.
          • 2. Re: how to load and call methods of a c# dll in Java application
            jschellSomeoneStoleMyAlias
            891462 wrote:
            "Is it possible to load c# dll in java application. If so how can I load it in my application. Plz help me".
            Possible but not as easy as C/C++.

            There is a thread somewhere that discusses it. It MIGHT have something to do with messing around with the c# manifest (which isn't the same as java.) But I could be remembering that wrong.

            If it was me I would wrap the dll in a an exe, add a comm api (stdio or socket) and then manage the exe in java via Runtime.exec() or ProcessBuilder.