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

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

问题描述

我知道java webstart正在一个安全的沙箱下运行。可以在jar中包含.dll / .exe(或将webstart下载到本地机器),然后执行它(使用Runtime.exec或进程等)



请咨询。欢迎任何建议/意见!

解决方案

是的。您必须在 .jar 文件中包装 .dll ,并将其引用到您的 .jnlp 文件使用< nativelib>



请参阅这里,以获得更详细的描述。



如果你想运行一个可执行文件,那么你最好的打算是将它作为一个资源打包在你的 .jar 中,将其解释为(说)临时目录,然后使用正常的Process / Runtime机制运行它。


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!

解决方案

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.

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天全站免登陆