| | |
Another "cannot find symbol" compiling error
![]() |
•
•
Join Date: Dec 2004
Posts: 2
Reputation:
Solved Threads: 0
Hi,
I'm very new to Java and I have the following problem while compiling a source code:
I've ran the compiler with the following flags:
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.
I'm very new to Java and I have the following problem while compiling a source code:
Java Syntax (Toggle Plain Text)
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:
Java Syntax (Toggle Plain Text)
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.
•
•
Join Date: Dec 2004
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
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?
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:
Java Syntax (Toggle Plain Text)
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:
Java Syntax (Toggle Plain Text)
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
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
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.
![]() |
Similar Threads
- Cannot find symbol, Constructor... (Java)
- Cannot find symbol (Java)
- compiling error, tried debugging but no luck (C)
- compiling error wtf!?!? (C)
- Please help me out, need help (C)
Other Threads in the Java Forum
- Previous Thread: Determining correct size of JDesktopPane
- Next Thread: Programmer needed (Paid)
| Thread Tools | Search this Thread |
addball android applet application apps array automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) button card class classes client code collision columns component constructor crashcourse css database designadrawingapplicationusingjavajslider draw eclipse ee error eventlistener exception expand fractal free game givemetehcodez graphics gui guidancer html ide image integration intellij j2me java javaarraylist javadoc javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia jvm linux loan loop method migrate mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle phone physics plazmic print problem program programming project radio scanner server service set sharepoint smart sms smsspam software sql subclass support swing textfield threads tree trolltech unlimited utility windows






