This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Error: Non-static method overrides static method


Florian Bourgier wrote:
> The code I am working on is not free. So I tried to create code which 
> generate the error I had but I could not recreate it.
> How can I debug my error ?

I'm afraid without a free testcase that can reproduce the
problem, it is really difficult to help. :-(

One quick thing to check: if you have a FrameworkFactory.class
file also (along with the Java source), try deleting it and
see if your problem goes away. (If it does, this problem
will most likely have been fixed by GCC 3.5.)

Another thing to try out: if you or anyone else in your
company has access to a Linux box, you can check out the latest
GCJ sources, compile it for yourself and see if the latest
(as yet unreleased) version still exhibits the same problem.

See:

  http://gcc.gnu.org/install/

(It should also be possible on CygWin, but I don't know
if anyone regularly builds GCJ for CygWin.)


> Is there any tool to see what gcj is doing and how it is precessing the 
> code ?

Yes, the GNU Debugger (GDB):

  http://sources.redhat.com/gdb/

Version 6.1.1 is recommended.

GCJ spawns another process ("jc1") to actually compile
the file - to attach the debugger to this process, you
might find these scripts useful:

  http://gcc.gnu.org/ml/gcc/2004-03/msg01195.html

You can then debug like:

  debugx jc1 the-command-line-you-used-to-compile-your-program

If you see the current sources, $GCC_SRC/gcc/java/class.c
line 2223 (method layout_class_method) is the only place
from where this error is emitted.

Try setting a breakpoint around here and see what is
going wrong...

Does this help?

Good Luck!

Ranjit.

-- 
Ranjit Mathew          Email: rmathew AT gmail DOT com

Bangalore, INDIA.      Web: http://ranjitmathew.tripod.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]