I'm having a problem with running exe files with Java. I want to add a program onto a banner with Java that will execute from a hosting website on any computer. The program is 500kb and it is an exe. How would i accomplish this?
PS: i just started with Java a few days ago and i have been searching for an answer for hours now , please help [ August 08, 2008: Message edited by: Semir xx ]
Originally posted by Semir xx: i just want it to execute a file that i will be hosting on a website
It is that 'from a website' that scares me now. What type of Java application are you running? An Applet? WebStart? Servlets? I think you will run into serious troubles with any of these technologies, but different problems for each.
posted 12 years ago
i want to host an exe file that can be launched using a java applet from any location, the file is around 500kb in size. is it possible at all?
And how are you getting permission from the client to run this exe file? If you have permissions, you can read the exe file from the server, write it to a folder on the client and then user Runtime class to execute it.
As Norm mentioned, by default, Applets are not allowed to do a ton of stuff needed for the task. To enable it, you need to first sign the applet. Then you need to enable that sign applet to do those normally restricted tasks. And this needs to be done on every client that you want to run the applet.
If you just want to casually put an executable program on your server and have it run on the client system (which is what your original post sounds like) then forget it. Don't even try. Running executable programs on other people's computers is a serious no-no as it's how malware gets spread around the Internet.
I have built a mulitple cilents one server chat type application.
Now I also want to autorun an exe file through java applets on clients whenever they connect with server.This file will definitely contain some code.Can you help how can i make this exe file autorun???
Waiting for reply.....
What you want: automatically running an exe on a client when someone visits a server via a website with an applet, is fortunately not possible. It would be a huge security problem if this would be possible.