File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 41815
    
  62
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: 18564
    
    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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet runs in eclipse, but when I embed it in html, it doesnt work