Exporting application to be runnable
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 t开发者_开发技巧o an executable application.
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:
mono my.exe
As it happens, the C# compiler (typically csc) is normally available in the framework, but you shouldn't need it in this case.
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).
精彩评论