Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
801 views
in Technique[技术] by (71.8m points)

windows - Is it possible to use Java webstart execute .exe or dll?

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...