是否可以使用 Java webstart 执行 .exe 或 dll? [英] Is it possible to use Java webstart execute .exe or dll?

查看:40
本文介绍了是否可以使用 Java webstart 执行 .exe 或 dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 java webstart 在安全沙箱下运行.是否可以在 jar 中包含 .dll/.exe(或让 webstart 将其下载到本地计算机)然后执行它(使用 Runtime.exec 或 process 等)

I know java webstart is running under a secure sandbox. Is it possible to include a .dll/.exe in the jar (or have the webstart download it to the local machine) and then execute it (using Runtime.exec or process,etc)

请指教.欢迎任何建议/意见!

Please Advise. Any suggestion/comment is welcome!

推荐答案

是的.您必须将 .dll 包装在 .jar 文件中,并使用 在您的 .jnlp 文件中引用它.

Yes. You have to wrap the .dll in a .jar file, and reference it in your .jnlp file using <nativelib>

请参阅此处以获得更详细的说明.

See here for a more detailed description.

如果你想运行一个可执行文件,那么你最好的办法是将它作为资源打包在你的 .jar 中,将它分解到(比如)一个临时目录,然后使用正常的进程/运行时机制.

If you want to run an executable, then your best bet is to package it up in your .jar as a resource, explode it to (say) a temporary directory, and then run it using the normal Process/Runtime mechanism.

这篇关于是否可以使用 Java webstart 执行 .exe 或 dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆