是否可以将 exe 文件转换为 jar 文件?

发布于 2024-10-08 16:32:27 字数 195 浏览 0 评论 0原文

是否可以将 exe 文件转换为 jar 文件?

因为我刚刚制作了一个在线游戏,并且是.exe文件格式,并且我有一个运行linux的服务器。也许可以在服务器上运行 exe,但这两种方法之一对我来说非常好!

所以方法是:

  1. 将 EXE 转换为 Java,或者
  2. 在 Linux 中运行 EXE

Is it possible to convert an exe file to a jar file?

Because I just made a game which is online and in .exe file format, and I have a server running linux. It may be possible to run the exe on the server, but one of the two ways would be very good for me!

So the ways are either:

  1. Convert EXE to Java, or
  2. Run EXE in Linux

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

秋千易 2024-10-15 16:32:27
  1. 这是不可能的。 EXE(实际上是PE)是Windows系列操作系统使用的二进制格式。它包含汇编的机器代码以及与操作系统交互的导入和导出表。 JAR 包含 java 字节码。遗憾的是,它们不兼容(实际上 JVM 从运行中的 Java 字节代码生成机器代码,但另一个方向是不可能的,而且也没有什么意义……)。

  2. 查看葡萄酒。它模拟部分 Windows API,因此可以运行所有本机 Windows 应用程序的子集。

  1. is impossible. EXE (actually PE) is the binary format used by the Windows family of operating systems. It contains assembled machine code and import and export tables to interact with the operating system. JAR contains java bytecode. Sadly, they are not compatible (actually the JVM generates machine code from the Java byte code on the fly, but the other direction is not possible AND makes very little sense, too …).

  2. Check out Wine. It emulates part of the Windows API so it can run a subset of all native Windows applications.

从此见与不见 2024-10-15 16:32:27

你可以在Wine下的Linux上运行EXE(除非你使用DirectX或类似的东西),但是它有什么用呢?您的游戏是某些分布式游戏的服务器端(即客户端计算机上运行客户端的游戏服务器)吗?

更新:另一种选择是在 Linux 服务器上运行装有 Windows 的虚拟机。这样可以更可行。

You can run EXE on Linux under Wine (unless you use DirectX or alike), but what's the use of it? Is your game a server side of some distributed game (i.e. game server with clients running on the client computers)?

Upd: One more option is to run a virtual machine with Windows inside on your linux server. This can be more viable.

长不大的小祸害 2024-10-15 16:32:27

是否可以转换exe文件
到 jar 文件。

除非 exe 是由 Java 源代码制作的,否则不会。并且您有源代码。但这不是转换,而是重新编译。

在 Linux 中运行 EXE

Wine 将运行 Windows 可执行文件。但是如果你有源代码为什么不直接用java运行它呢?

Is it possible to convert an exe file
to a jar file.

Not unless the exe was made by Java source. and you have the source code. but then it isn't a conversion, its a recompilation.

Run EXE in Linux

Wine will run windows executables. But if you have the source why not just run it with java?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文