DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Another "cannot find symbol" compiling error (http://www.daniweb.com/forums/thread24584.html)

aaaa May 29th, 2005 4:25 pm
Another "cannot find symbol" compiling error
 
Hi,
I'm very new to Java and I have the following problem while compiling a source code:


g:\Java\Proj\baseline.java:1487: cannot find symbol
symbol  : constructor a(baseline)
location: class baseline.a
                          k.setItemStateListener(new a(this));
                                                ^


I've ran the compiler with the following flags:

javac -d g:\Java\Proj\compiled\ -classpath g:\Java\WTK2\wtklib\emptyapi g:\Java\Proj\baseline.java

The source files are composed by a file called "baseline.jad" and another called "a.jad" which are in the same folder. Now I've renamed both files with the ".java" extension.
I don't know much about java but I think that the error could be caused by wrong filename/folder of the "a.java" or if the "a.java" class must be imported/declareted in some way in the "baseline.java" source.
Many thanks in advance for any help. ;)

server_crash May 30th, 2005 4:38 pm
Re: Another "cannot find symbol" compiling error
 
I'm not sure I undestand what your doing with the calll of new a(this)...Could you explain.

The way you have it, it's like you have an inner class called a, and your are trying to pass the whole class to it. Am I correct?

aaaa May 31st, 2005 3:06 pm
Re: Another "cannot find symbol" compiling error
 
Quote:

Originally Posted by server_crash
I'm not sure I undestand what your doing with the calll of new a(this)...Could you explain.

The way you have it, it's like you have an inner class called a, and your are trying to pass the whole class to it. Am I correct?

Probably it may sound ridiculous but neither I know what this call to "a" exactly is. :rolleyes: :lol:

I try to explain myself better:
I've the sourcecode of a Java app for mobile phones and I need to recompile it.
So I've downloaded the J2ME classes (microedition.midlet, etc.) and now I'm stuck with 8 compiling errors.

The sourcecode is composed by 8 files:
baseline.jad, a.jad, b.jad, c.jad, (...), g.jad

At the beginning "baseline.java" calls (imports?) each class with this code:

import java.util.Calendar;
import java.util.TimeZone;
import java.util.Enumeration;
import javax.microedition.midlet.MIDlet;

public class baseline extends MIDlet
    implements CommandListener
{

    final void a()
    {

// CODE CUT

    }

final void b()
    {

// CODE CUT

    }

// ETC.



The beginning of a.jad file is:

import javax.microedition.lcdui.*;

final class a
    implements ItemStateListener
{

// CODE CUT

}

So, why I get this compiling error?

I really hope that this can help, as I've said before I'm quite new to Javaso I apologize for the inaccuracy of the question :rolleyes:

I can provide more info if needed.
Many thanks for your help ;)

server_crash May 31st, 2005 3:41 pm
Re: Another "cannot find symbol" compiling error
 
The imports statements simply import classes that you need from the java library , not the classes that you are trying to instantiate in your program. Have you compiled all the other classes before trying to compile that one class with the errors? Or are you getting errors with those other classes? See, in order for that code to run, there must be a class called a, which there is, but it also must already be compiled or the compiler wont recognize it.


All times are GMT -4. The time now is 1:24 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC