FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Discussion
   General Processing Discussion
(Moderators: fry, REAS)
   Java applet frustration
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Java applet frustration  (Read 557 times)
amoeba

WWW
Java applet frustration
« on: May 19th, 2004, 12:36pm »

OK, I've tended to ignore this issue, but now I need to fix it.
 
What is the reason that the Internet Explorer JVM displays "class not found" errors on just about any complex Processing applets? I know that it doesn't actually mean it didn't find the class, but rather "something went wrong". I've seen it on my own work, but also in plenty of pieces posted online. Should I look for non-JDK 1.1 code, or is there a known issue with some Processing code?
 
I am posting a new project today, and would badly want this to go away. Otherwise I will have to tell people to download the Sun plug-in, which is not too bad but annoying all the same.
 
For reference the piece in question can be seen here, it's for the Atmosferas.net net gallery.
 

marius watz // amoeba
http://processing.unlekker.net/
TomC

WWW
Re: Java applet frustration
« Reply #1 on: May 19th, 2004, 1:38pm »

Are you compiling using the Processing environment, or with Eclipse or some other IDE?
 
Are you using external files (in the code directory)?
 
amoeba

WWW
Re: Java applet frustration
« Reply #2 on: May 19th, 2004, 1:47pm »

Compiling in JBuilder X. Using some of my own libraries, but nothing that should use JDK 1.1-unfriendly stuff. I would post the code except it's a huge mess and lots of different files. Suffice to say, I've had this problem before even when doing stuff inside Processing and I've seen it in P5 applets people have posted online.
 
PS: I'm not saying it's a bug in Processing, it's probably either a non-JDK 1.1 issue or it's that !?"#! stupid Explorer app.
« Last Edit: May 19th, 2004, 1:49pm by amoeba »  

marius watz // amoeba
http://processing.unlekker.net/
TomC

WWW
Re: Java applet frustration
« Reply #3 on: May 19th, 2004, 1:54pm »

Are you setting the target in your compiler options?
 
I think (I should look at the source and stop guessing) that Processing compiles with "-target 1.1", and I think that if non 1.1 code is used then it will compile anyway but not work with the MS JVM.  I think.
 
Anyway, "-target 1.1" is worth a try.
 
amoeba

WWW
Re: Java applet frustration
« Reply #4 on: May 19th, 2004, 2:16pm »

Thanks, Tom. I tried fiddling with building options inside JBuilder, but no luck. I can't find JDK 1.1 on the Sun site anymore, otherwise I would try downloading that and making JBuilder use javac to build.
 
Was kind of hoping there was an obvious solution
 

marius watz // amoeba
http://processing.unlekker.net/
TomC

WWW
Re: Java applet frustration
« Reply #5 on: May 19th, 2004, 2:28pm »

Next thing to try is making sure that you have 1.1 friendly versions of any libraries you're using.
 
What external classes are you using?  The pages for most classes in the Java API documentation (http://java.sun.com/j2se/1.4.2/docs/api/index.html) have a "Since" section which tells you when it was introduced.
 
fry


WWW
Re: Java applet frustration
« Reply #6 on: May 19th, 2004, 2:48pm »

tomc is right on re: the -target 1.1 stuff, although jikes 1.18 is broken for that (that's why we have to include our own jikes with p5), jikes 1.19 seems to remove -target 1.1 altogether, and i think maybe javac 1.4 doesn't let you go back to 1.1 either (only 1.2+), but i'm not sure.
 
also likely, you're probably using a couple 1.1 features, either classes or syntax. usually it's the syntax stuff that throws things off.. check out the beginning of bugs.txt for some possibilities.
« Last Edit: May 19th, 2004, 2:50pm by fry »  
toxi_
Guest
Email
Re: Java applet frustration
« Reply #7 on: May 19th, 2004, 4:34pm »

i think 1.4's javac still supports the "-target1.1" option as i've been successfully using this in my Ant build script for eclipse. marius, i'd recommend the same to you: just install Ant and modify the xml file for use with your JBuilder stuff. That export part is not directly tied into working with Eclipse only, you know?
 
also, make sure not to use the 1.2+ only methods in some classes (eg. Vector). i came across the same IE JVM messages like you did and replacing eg. Vector.add() (1.2) with Vector.addElement() (1.1) fixed problems. for other method's like Vector.toArray() i just copied the method's source from the original class definition and put them into my own utility class.
 
amoeba

WWW
Re: Java applet frustration
« Reply #8 on: May 19th, 2004, 4:49pm »

Ahhhh... Fixed it. I managed to find JDK 1.1.8 on java.sun.com, downloaded it and told JBuilder to use that to compile. It immediately gave me errors for some classes that were in my project tree, but that were not used or referenced in my code in any way. I have an amoebaLib package with several subpackages, but I was only using classes with no references to Java2D etc.
 
After manually selecting only the files I needed from the amoebaLib package I was able to recompile, export to ZIP and voila: Internet Explorer runs the project without a hitch, even if I compile it with JBuilder.
 
Thanks guys, now I know what to try next time I have the same problem. I'm still a little mystified as to why it would choke on classes I'm not using, but finding the bug is enough for now.
« Last Edit: May 19th, 2004, 4:50pm by amoeba »  

marius watz // amoeba
http://processing.unlekker.net/
Pages: 1 

« Previous topic | Next topic »