Roy Chan
Roy Chan

Reputation: 2918

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!

Upvotes: 5

Views: 5478

Answers (2)

Brian Agnew
Brian Agnew

Reputation: 272367

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.

Upvotes: 6

jsight
jsight

Reputation: 28419

Yes, as long as the user grants your application privileges (via the dialog that pops up), then Java webstart will have access to the file-system, and will have permission to use Runtime.exec.

Upvotes: 1

Related Questions