Can you use Java libraries in a VB.net program?

后端 未结 8 1966
青春惊慌失措
青春惊慌失措 2020-12-03 16:36

I\'m wondering if a Java library can be called from a VB.net application.

(A Google search turns up lots of shady answers, but nothing definitive)

8条回答
  •  旧巷少年郎
    2020-12-03 16:43

    If you have the source code and compile it using the J# compiler, then the answer is yes. If you want to call any pre-Java 2 (aka 1.2) libraries, then these are included pretty much verbatim with J#. More recent stuff is going to be tricky though (i.e., it's not there).

    An example where this is used commercially are the yFiles graph layout algorithms from yWorks. These were originally just a Java library, but for the past few years they've been offering a .NET version, which is just the Java version compiled with Visual J#.

    It's not without problems, and there are some limitations that you can't get around, but it can be done. So... unfortunately this answer looks pretty shady as well.

提交回复
热议问题