导出可运行的应用程序
我使用 C++、C# 和 Java 构建应用程序。但是,当我尝试将输出文件复制到另一台机器时,它不起作用...对于 Java,我必须复制源代码,安装 SDK 并通过 CMD 或编译器将其合并...我想知道如何使用 C++ 和 C# 创建的 .exe 文件在其他机器上使用,而无需安装 Visual Studio 或任何其他编译器...对于 Java,我想知道如何导出我的代码到可执行应用程序。
I build applications using C++, C# and Java. But when I try to copy the output file to another machine it won`t work ... and for the Java, I have to copy the source code, install the SDK and jun it through the CMD or through a compiler ... I want to know how to use the .exe files created by C++ and C# to be used on other machined without the need to install the Visual Studio or any other compiler ... And for the Java, I want to know how to export my code to an executable application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 .NET (C#),您不需要任何编译器;将其构建为 exe,并将其发送到任何具有 .NET 运行时的计算机。对于 Windows 和 MS .NET,只需运行它即可。对于 mono,您需要告诉 mono 运行它:
碰巧,C# 编译器(通常是 csc) 通常在框架中可用,但在本例中您不需要它。
In the case of .NET (C#) you don't need any compiler; build it as an exe, and ship that to any computer with a .NET runtime. For windows and MS .NET, just run it. For mono, you'll need to tell mono to run it:
As it happens, the C# compiler (typically csc) is normally available in the framework, but you shouldn't need it in this case.
至于Java:使用正确的清单构建一个JAR文件,它应该在任何具有至少所需版本的JVM的机器上运行(即对于Java 5代码JRE 5+)。您还可以将代码作为一堆 .class 文件分发到目录中,但这不是标准方法。
对于C++:为特定平台编译应用程序并提供所需的dll(例如microsoft 运行时重新分发包)。
As for Java: build a JAR file with a correct manifest and it should run on any machine with a JVM of at least the required version (i.e. for Java 5 code JRE 5+). You could also distribute the code as a bunch of .class files in directories, but that's not the standard way.
As for C++: Compile the application for a specific platform and supply the needed dlls (e.g. the microsoft runtime redistribution package).