简体   繁体   English

在Linux下从Java访问Windows dll(可能通过Wine)

[英]Access a Windows dll from Java under Linux (probably through Wine)

I've managed to run JavaFX 2.0 under Linux by following this guide . 我按照本指南设法在Linux下运行JavaFX 2.0。 It works nicely by running a Windows version of Java using Wine. 通过使用Wine运行Windows版本的Java,它可以很好地工作。 This Java process can pick up the native .dll files of the Windows version of JavaFX. 此Java进程可以获取Windows版JavaFX的本机.dll文件。

Now I wonder if there is a different solution that runs a Linux version of Java but somehow makes access to the .dll files through Wine. 现在我想知道是否有一个不同的解决方案运行Linux版本的Java,但不知何故通过Wine访问.dll文件。

To sum it up graphically: 以图形方式总结:

  • works: Wine -> Java(win) -> DLL(win) 作品: Wine - > Java(win) - > DLL(win)
  • what I'm asking: Java(linux) -> Wine -> DLL(win) 我在问什么: Java(linux) - > Wine - > DLL(win)

Why I want to do it 我为什么要这样做

I have the hope to make the application start like any other Java application and only require an installation of Wine. 我希望使应用程序像任何其他Java应用程序一样启动,并且只需要安装Wine。 The already working solution requires a Wine installation and a Windows version of Java. 已经运行的解决方案需要Wine安装 Windows版本的Java。

I doubt wine makes .dll appear as .so Wine works by creating an emulated environment and applications have to be run inside that environment to work. 我怀疑葡萄酒会使.dll显示为.so Wine通过创建模拟环境来工作,并且应用程序必须在该环境中运行才能工作。

What you should be able to do is 你应该做的是

Java(linux) -- socket --> Java(Wine) -- loads --> DLL(win)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM