如何在java src代码中存储可执行程序? [英] How do I store an executable program inside of a java src code?
本文介绍了如何在java src代码中存储可执行程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想存储一个可执行文件供我的Java应用程序调用。我想将这个Java应用程序变成光盘上的可执行文件,并将Java程序中的可执行文件调用到其他地方。
我试过的:
我曾尝试使用Java将可执行文件放入其中,以及像Neteans和Eclipse IDE这样的IDE。
Hi,
I want to store an executable file for my Java application to call. I want to make this Java application into an executable on a disc and for the Executable file in the Java Program to be called elsewhere.
What I have tried:
I have tried to use Java to put my executable file into it as well as IDEs like Neteans and Eclipse IDE.
推荐答案
在所有现实中,JAR包只是一个ZIP文件,你可以直接在其中嵌入任何文件类型;比如你的可执行文件。真正的诀窍是如何运行该文件。
简单回答 - 从您的Java应用程序中读取可执行文件并将其作为可执行文件写入光盘。然后你可以打电话给那个复制的文件。
来源:
Stack Overflow:在Java应用程序中嵌入可执行文件 [ ^ ]
Stack Overflow:Java编程:从Java调用exe并传递参数 [ ^ ]
In all reality a JAR package is just a ZIP file, and you can directly embed just about any file type within it; such as your executable. What the real trick becomes is how to run that file.
Easy answer- read the executable from within your java application and write it as an executable file to the disc. You can then place a call to that copied file.
Sources:
Stack Overflow: Embedding Executable in Java Application[^]
Stack Overflow: Java Programming: call an exe from Java and passing parameter[^]
这篇关于如何在java src代码中存储可执行程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文