Hi all, I'm new to this applets world and have a basic doubt with loading an applet. Should all the classes that I use in my applet be present in the same codebase for the browser to find those files? I think the other way is to jar all the files and preload them using <archive> tag. If so, then how does the browser find the path of all the java library files (which I would have used in my applet class files? The reason of my above doubt is this problem : I am using openjms (a freely available open source JMS utility ) in my applet application and my applet is importing and using many classes from that library. Though I set the system classpath properly to whereever that openjms files are installed, I get an exception saying that the particular class file is not found when I try to load that applet remotely over the internet. My workaround is to have all those library class files in the same place from where the applet is getting loaded. But is it really necessary? If so, then as I asked before, how is the browser finding all the java core class files (like java.awt files or java.io files) which I have imported and used in the same applet class? Any help on this is greatly appreciated. Thanks in advance. Vidya.
It doesn't sound like OpenJMS is part of the core JDK, so you can't count on it being installed on the user's system. You should include the library jar file in your archive tags, and put it on your webserver for download to each client.
posted 16 years ago
Thanks Rob. But I again got the following fundamental doubts... 1. Does the browser look for the library class files on the local PC from where the applet is being accessed? I was under the impression that it takes it from the server where the applet is sitting and that server can look at its classpath and provide the files to the browser. Is it not so? 2. I tried to run the applet thro' the internet from the same machine where the applet is sitting(server machine). I assumed now that the browser has to find the OPENJMS class files as I have them in my system and the classpath is set properly,so I didn't include the OPENJMS library class files in archive tag. But still I get the same error that class files are not found. Why is it so? Shouldn't the browser check for the files from the class path atleast in this scenario? I am really confused and stuck with the things here. Please help. Also could you please suggest me some good links where I can read about how the browser gets the library files and where does it look for classes when the applet is loaded and stuff like that? Thanks a lot. Vidya.