Click to See Complete Forum and Search --> : Do Java applets require a server to run?


Wallex
09-08-2002, 04:52 PM
Gee.. I haven't coded in Java in a long while. I am trying to make an applet, and whenever I try to run it from the browser (the html that contains the applet, that is) I get a AccessControlException, meaning I don't have permission to access the file. I tried chmodding the class +4777, so it means that in order to get the applet running, I need to setup an Apache server? And if this is the case... is there any other way make a class that will work as an applet and as a standalone? (meaning that it will work when I do a java myclass.class and when I call the myclass.class from the webpage)?

mingshun
09-09-2002, 11:11 AM
Hi,

The last time that I coded an applet was about 1.5 yr ago. I don't think you need a server to run applet. Just the appletview would do.

Wallex
09-09-2002, 09:07 PM
Yeah it worked on my friend's machine... on mine I still get permission errors. Hmm... maybe it's the htm file the one that needs run permissions, I haven't thought about that one. But it still does not works... this is weird.. I know it's right because it works on my friends' house, but here I keep getting permission denied errors... the .htm file has exec permission, so does the .class file. This puzzles me... maybe it has to do with permissions set in Mozilla? Oh well.. I'll have to keep trying stuff.

Sawdusty
09-10-2002, 07:59 PM
Have you tried the applet in appletviewer? You should be able to run:

appletviewer mypage.html

and appletviewer will dig the applet code out of the html file.

Check your permissions on the java binary.

Do any other applets work in mozilla? Do you have the plugin properly installed?

HTH

Dusty

Wallex
09-14-2002, 08:09 PM
Appletviewer works but not when the applet is in Mozilla. This means the plug-in is broken? I found another thread with the exact same problem, and it was never 'solved'. The problem is that 'buttons don't work', you click on them and nothing happens.. but when you try it on the applet viewer it does works. Maybe I have the wrong plugin selected... my Mozilla's java plugin is:

/usr/local/mozilla/plugins/libjavaplugin_oji.so which is a symlink to /usr/java/j2sdk1.4.0_02/jre/plugin/i386/ns610/libjavaplugin_oji.so

I have tried with the other plugins that came with jre (the one in ns400 and ns600), but neither of these work.. could it be a bug in the virtual machine or I am just messing up somehow?