This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Applets and the fly likes Applet runs in eclipse, but when I embed it in html, it doesnt work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet runs in eclipse, but when I embed it in html, it doesnt work " Watch "Applet runs in eclipse, but when I embed it in html, it doesnt work " New topic
Author

Applet runs in eclipse, but when I embed it in html, it doesnt work

Paul Wagner
Greenhorn

Joined: Nov 13, 2009
Posts: 14
I have written an applet, that runs c++ exe... it works fine in eclipse, but today I embedded it in html page and its not doing any thing at all.. any suggestions..

one thinig more, when I run my applet in eclipse. the c++ exe runs fine... but after embedding applet in html, the c++ exe is not running.

I used

Process process = Runtime.getRuntime().exec("exe name " + arg1 + arg2);

to run the exe on button event.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41029
    
  43
Check the Java Console - it probably contains error messages. In particular, calling Runtime.exec is not allowed in applets unless they are signed or the local security policy has been altered. See HowCanAnAppletReadFilesOnTheLocalFileSystem for more details.


Ping & DNS - my free Android networking tools app
Paul Wagner
Greenhorn

Joined: Nov 13, 2009
Posts: 14
yes you are right, my applet is not signed... thats the reason... thnx
Paul Wagner
Greenhorn

Joined: Nov 13, 2009
Posts: 14
Hi Dittmer,

I have signed the applet and its still not reading the files on the file system or starting a process through runtime.exec(). has it something to do with access control list in java ? any idea ?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Could be all kinds of things. Perhaps your code makes some assumption about the current working directory when Runtime.exec runs. Perhaps you're trying to run an executable which isn't on the computer where the applet runs. We could make a longer list but there isn't any point.

Are you getting an exception from Runtime.exec? Don't just say "it doesn't work", find out why not. Look at the Java console in the browser for a start.
 
Consider Paul's rocket mass heater.
 
subject: Applet runs in eclipse, but when I embed it in html, it doesnt work
 
Similar Threads
HTML wont run Applet
Swing applet won't run. load class not found.
applet not initialized
Problem with running a program from Java file
help set up a config file