0

I have created a NuGet package (.Net standard 2.0 and .Net Framework 4.8 - compatibility) that I would like to know if it is possible to access from a Java application.

zinc1oxide
  • 490
  • 3
  • 15

1 Answers1

0

Nuget is a package format that is used in .NET. Not in Java. Java has Maven for that. So there is no simple way (or any way I could recommend) to use the code easily in Java.

But if you really need to use the methods you have in the package, you can try to do the following:

  1. Compile the code that the package contains, so that you have .dll file
  2. Try to make use of the compiled dll in Java. I don't know much Java but it seems this is already answered in Stack Overflow: How to call a method in DLL in a Java program

Basically you should be able to call the methods defined in your DLL. Similar thing you can do in .NET. It is possible to take a dll, and call it's methods from .NET knowing the method signature. It is called Interoperability

Also please note that the nuget package is a zip repository in fact. You can open it using any zip tool, you can extract it and compile the code with dotnet command.

Krystian
  • 122
  • 1
  • 10