java.lang.ClassCastException on a linux FC3 box
Experts again,
I installed jdk1.5.0_06 on my RedHat FC3 and - after some initial problems - got the symlinks pointing to the jdk files now instead of the standard FC ones. But: it seems that my standard java classes can't still be found. So when I want to run one of the famous introductory examples by typing
> appletviewer swingUI.html
I get the prompt
java.lang.ClassCastException: SwingUI
at sun.applet.AppletPanel.createApplet(AppletPanel.java:721)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:650)
at sun.applet.AppletPanel.run(AppletPanel.java:324)
at java.lang.Thread.run(Thread.java:595)
and the appletviewer tells me the applet wasn't initalised.
Any ideas what's wrong with my setup?
Thanks in advance: Five Rings
[811 byte] By [
fiveringsa] at [2007-10-2 21:44:45]

> why you don't try to search what that exception is
> for? and follow the stack trace and cut the error
> off, or handle the expection ?
how do you handle a ClassCastException? there's no safe way to recover from it other than to ignore it and start again, which basically means the software won't ever do what it's designed to do. runtime exceptions need a fundamental code fix, not error handling
> wen getting the symlinks to work, did you move the
> actual executables or just fix the symlinks. If you
> moved the executables then the path to the actual
> classes is unknown. Try setting JAVA_HOME env var to
> point to the new installation.
Thanks Chris ... and everybody else thinking about my problem. I just set the symlinks, pointing now to /usr/share/jdk1.5.0_06/bin/... That's where I told the installer to place my binaries.
As I don't know how to search for the class files (e.g., using locate or else): is it a good guess to set the path to /usr/share/jdk1.5.0_06/lib? Are those standard classes precompiled as .jar-files? I got a number of those in my .../lib.
Sorry to bother you... I really started w/ java yesterday...
THX - Five Rings