some useless SWING import occurs error

Andrew Haley aph@redhat.com
Tue Mar 25 10:27:00 GMT 2003


Steve Ni writes:
 > I compile a jar package, it contains some classes which import java.swing.*
 > , these class are useful for my program, but I never call those methods with
 > swing API , GCJ stop compile process:
 > 
 > org/na/debug/Debugger.java:85: error: expected type 'javax.swing.JTable' but
 > stack contains 'void'
 > org/na/debug/Debugger.java:85: error: expected type 'org.na.debug.Debugger'
 > but stack contains 'javax.swing.JTable'
 > org/na/debug/Debugger.java:85: confused by earlier errors, bailing out

This might be a verifier bug.

 > Can I skip those error to go on my compiled process?

Yes.  But of course if anything refers to the problem code you won't
get a successful link.

 > Can I depened on java.swing.* package from Sun JDK to help compile
 > successfully?

No.  Even if this did work you'd probably be violating some licence or
other.

I suggest you remove the errant code and replace it with dummy
methods.

Andrew.



More information about the Java mailing list