The Artima Developer Community
Sponsored Link

Java Answers Forum
Error: cannot resolve symbol

2 replies on 1 page. Most recent reply: Jan 29, 2006 8:57 PM by Vijay Nathani

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Atreo De Maio

Posts: 2
Nickname: atreo
Registered: Jan, 2006

Error: cannot resolve symbol Posted: Jan 27, 2006 3:38 PM
Reply to this message Reply
Advertisement
I have that error and I don't know what else I can try.
The situation is the following:

'PuntoI.java' is an interface.
'Punto.java' is a class.
'Punto2Di.java' pretends to be an implementation of 'PuntoI.java'

----jGRASP exec: javac -g D:\Universidad\2_Edi\2005-2006\PrJAVA\Punto2Di.java

Punto2Di.java:13: cannot resolve symbol
symbol : class PuntoI
location: class estructuras.Punto2Di
public class Punto2Di implements PuntoI
^
Punto2Di.java:22: cannot resolve symbol
symbol : class Punto
location: class estructuras.Punto2Di
public Punto construir(double X, double Y)


Any idea of the solution?

Thank you very very much for your attention and help.


Atreo De Maio

Posts: 2
Nickname: atreo
Registered: Jan, 2006

Re: Error: cannot resolve symbol Posted: Jan 29, 2006 2:10 PM
Reply to this message Reply
I think I've done some progress...

I've writen the class 'Punto' and the interface 'PuntoI' inside a file called 'estructuras.java'.
When I compile two files are generated: 'Punto.class' and 'PuntoI.class'.

But I'm still trying with my other friend 'Punto2Di.java'. It doesn't compile due to this:

----jGRASP exec: javac -g D:\Universidad\2_Edi\2005-2006\estructuras\Punto2Di.java

Punto2Di.java:1: package estructuras does not exist
import estructuras.PuntoI;
^
Punto2Di.java:13: cannot access PuntoI
bad class file: .\PuntoI.class
class file contains wrong class: estructuras.PuntoI
Please remove or make sure it appears in the correct subdirectory of the classpath.
public class Punto2Di implements PuntoI
^
2 errors

I have another change to tell. Now the folder where these files are is called as the package 'estructuras'.

Maybe the error is because I have to include the package somewhere or I have to specify by the CLASSPATH or PATH variables.
I'm still very very new to these parameters and variables, but I'm trying...

Am I right?
Any suggestion?

Thank you very much for your help it's being great.
Edit/Delete Message

Vijay Nathani

Posts: 29
Nickname: vijaynath
Registered: Jan, 2006

Re: Error: cannot resolve symbol Posted: Jan 29, 2006 8:57 PM
Reply to this message Reply
Please keep each class/interface in a seprate file.
It should compile fine as long as all of them are in the same directory.
I don't think that you need import or package statements.
Your classpath should either be unset or the current directory "." must be in it.
That should do it.
Vijay.

Flat View: This topic has 2 replies on 1 page
Topic: Programming problem Previous Topic   Next Topic Topic: Displaying  byte array as float values

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use