Communication Java and C #

I am working on a project that uses an RFID reader that only works with a C # library. The fact is that I would really like to work with Java (develop the rest of the program, a graphical interface, etc.) and use the C # program to ask the reader to read the information and return the line to the Java program.

So is there a way to do this?

Thanks in advance.

+4
source share
3 answers

One way to get closer to this is to consider it as a problem of interprocess communication. There are many options (assuming Java has access to the required Windows API, which I assume, but I'm not a Java developer).

Named pipes, TCP / IP, file system, Mailslots, etc.

Here is a good article about some of the options: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574 (v = vs .85) .aspx

Another option that I don’t know what to talk about is trying to load the .Net library into your Java process.

+1
source

Could you use sockets? They both support this, but I never tried to do this between different languages.
Good luck.

+1
source

If you don't mind too deeply, you can use the native Java interface to generate code to forward calls from Java to C # and vice versa. You will need to build a "bridge" in c / C ++ (C ++ is usually a bit simpler).

This way you get communication in the process, which is the fastest way to work :-)

0
source

Source: https://habr.com/ru/post/1379732/


All Articles