1.6.0 class not found in condition not met
I have an applet that is conditionally not working with jre 1.6.0.
The error is a java.lang.NoClassDefFoundError.
My applet calls a General.class and in that General.class I cannot get a System.out.println to work on the first line of the constructor, because it seems to be jumping ahead 6 lines to execute :
if (a==0){
zzz =new com.company.Z();// error happens on this Z class
}
else{
// do not use com.company.Z class at all.
}
If "a ==0", then the Z.class's jar is available and it runs fine.
But if a is not 0, I get the java.lang.NoClassDefFoundError for Z.class because the Z.class is intentionally unavailable. Why does it run the condition part (a==0), when "a" does not equal 0.
I tried moving this "if" stmt code piece to a separate method, and that did not work.
Does the jre 1.6.0 scan ahead and load classes in conditional statements without evaluating the condition first?
And why can't I debug this with System.out.println ?
I would appreciate any "behind the scenes" incite.
Thanks, Sari

