Solved

"cannot resolve symbol"

Posted on 2004-03-26
37
498 Views
Last Modified: 2010-03-31
Hi everyone,

My situation is:
* I have a Java code (ok)
* I'm decompiling it (ok)
* I'm ONLY looking at the code (Changed NOTHING) (ok)
* I'm trying to compile the code again (and...)
* I'm getting the error: "cannot resolve symbol"

What could it be?
Thank you all.
0
Comment
Question by:GurkanGer
  • 15
  • 10
  • 6
  • +2
37 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688144
If you're recompiling the result of your decompile, the former has probably broken it
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10688148
Post the code where the error occurs
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688156
Sorry - i mean the decompile has probably broken it
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10688162
>> I'm decompiling it (ok)
You really mean DEcompile?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688175
>>Sorry - i mean the decompile has probably broken it

Which is of course a commonplace occurrence
0
 

Author Comment

by:GurkanGer
ID: 10688260
Dear zzynx,

The decompiler i'm using is "DJ Java Decompiler"
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10688337
All right.
I was confused because you were talking about "decompiling *code*" and  "compiling *again*"

>> I'm getting the error: cannot resolve symbol
= a variable/function name is used that isn't defined/declared
0
 
LVL 13

Expert Comment

by:Webstorm
ID: 10688348

Most Java decompiler don't support inner classes.
You must also decompile inner classes ( __the_class__$ ... .class )
0
 

Author Comment

by:GurkanGer
ID: 10688389
The code and error follows:
import java.awt.*;
import java.applet.*;
import java.awt.image.*;
import java.awt.event.*;

import com.lotus.sametime.core.comparch.*;
import com.lotus.sametime.core.constants.*;
import com.lotus.sametime.core.types.*;
import com.lotus.sametime.community.*;
import com.lotus.sametime.places.*;
import com.lotus.sametime.awarenessui.*;
import com.lotus.sametime.awarenessui.placelist.*;

/**
 * Meeting Applet sample showing how to create a chat only meeting
 */
public class ChatMeeting extends Applet
{
  private STSession m_session;
  private CommunityService m_comm;
  private Place m_place;
  private PlaceAwarenessList m_peopleList;
   
  private ChatPanel m_chatPanel;  //This is line 20
  private Label m_PeopleNumLbl;
   
  private static int numUsersInPlace = 0;
   
  /**
   * Initialize the applet. Create the session, load and start
   * the components.
   */
  public void init()
.....
The error is:
D:\Lotus\CM\ChatMeeting.java:20: cannot resolve symbol
symbol  : class ChatPanel
location: class ChatMeeting
    private ChatPanel m_chatPanel;
            ^


0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688393
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688408
That just means that class ChatPanel is not available to the compiler in the classpath
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10688439
maybe you have to put all source files in one package/directory "test"

Then start each source file with:

package test;
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688531
What package does ChatMeeting think it's in - if any?
0
 
LVL 13

Expert Comment

by:Webstorm
ID: 10688533

Another decompiler :
http://www.programfiles.com/Default.asp?LinkId=22748

>> maybe you have to put all source files in one package/directory "test"
How will this solve the problem ?

0
 

Author Comment

by:GurkanGer
ID: 10688578
I de&recompiled the innerclasses too, but no success.

Now i will try:
>Then start each source file with:
>package test;

And then JAD.

Hope to return with positive answer.
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10688619
>> How will this solve the problem ?
Think that if all files are in the same package,
they can "see" each other without any need to import them. No?

>> What package does ChatMeeting think it's in - if any?
Apparently CEHJ is also thinking in that direction
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688622
>>Now i will try:

I too don't know how that's going to help. And you didn't answer my question...
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688637
...oh and hold off on downloading any other decompilers too - faulty kit is not part of your problem from what i can see
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:GurkanGer
ID: 10688683
>What package does ChatMeeting think it's in - if any?

ChatMeeting is not in any package.
I'm calling this applet from a cab.
0
 
LVL 13

Expert Comment

by:Webstorm
ID: 10688760
>> they can "see" each other without any need to import them. No?
No package is needed to do that : the files may be in the same directory or not, but theses directories must be in the classpath.

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688776
Well you'll just have to make sure that all those private member variable classes at least are in the same directory
0
 
LVL 13

Expert Comment

by:Webstorm
ID: 10688788
>> I'm calling this applet from a cab.
if you put the cab file in the classpath, you will get a duplicate class error.
extract all classes from the cab file, or delete the recompiled class from it.

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688800
All classes are in a package in fact. It just happens that ChatMeeting is in the 'default package'
0
 

Author Comment

by:GurkanGer
ID: 10688832
>make sure that all those private member variable classes at least are in the same directory

No; the classes are not in the same directory, but they are defined in classpath.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688844
That should be OK
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10688859
...although it might makes things easier if they were
0
 

Author Comment

by:GurkanGer
ID: 10688969
I'm calling tihs applet within an HTML page with cabbase parameter, and all classes should be in the ChatMeeting.cab
I decompressed the cab file in to chatmeeting folder, decompile all classes and inner classes and saw the codes. And now trying to compile the ChatMeeting.java

You can find the cab file's original structure below.
>ChatMeeting$CommunityEventsListener.java
>ChatMeeting$ParticipantListListener.java
>ChatMeeting$PlaceEventsListener.java
>ChatMeeting.java
>ChatPanel$ChatAreaEventsListener.java
>ChatPanel$MyMsgEventsListener.java
>ChatPanel$TextFieldEventListener.java
>ChatPanel.java

Also I have another 2 cab files, and 2 jar files which I've been already added to classpath while compiling.



0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10689018
Have you tried just

javac *.java

in the source directory?
0
 

Author Comment

by:GurkanGer
ID: 10689083
>Have you tried just javac *.java

Okay, i tried and the answer was 87 errors 8-)
Sorry.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10689116
Right. Better start with just ChatMeeting then
0
 

Author Comment

by:GurkanGer
ID: 10689439
>Right. Better start with just ChatMeeting then

Yes?
0
 

Author Comment

by:GurkanGer
ID: 10689604
I decompiled the code with JAD, and i got different errors:

D:\Lotus\chatmeeting\ChatMeeting.java:51: cannot resolve symbol
symbol  : method bindToPlace  (com.lotus.sametime.places.Place)
location: class ChatPanel
            m_chatPanel.bindToPlace(placeevent.getPlace());
                       ^


D:\Lotus\chatmeeting\ChatMeeting.java:167: cannot resolve symbol
symbol  : constructor ChatPanel  (com.lotus.sametime.core.comparch.STSession,jav
a.applet.AppletContext)
location: class ChatPanel
        m_chatPanel = new ChatPanel(m_session, getAppletContext());
                      ^
D:\Lotus\chatmeeting\ChatMeeting.java:168: cannot resolve symbol
symbol  : method add  (ChatPanel,java.lang.String)
location: class java.awt.Panel
        panel3.add(m_chatPanel, "Center");
              ^
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10689618
..which is what you're already doing isn't it? Where are you at now?
0
 

Author Comment

by:GurkanGer
ID: 10690354
Sorry people,
The 100 points goes to nobody.

The answer was:

put a . (yes a dot) in the beginnig of the classpath.

Thanks to all
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10764944
At http://www.experts-exchange.com/Community_Support/CleanUp/ you can post a 0 points question
to ask to delete this question and to refund you the points.
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 10915345
PAQed, with points refunded (100)

ee_ai_construct
Community Support Moderator
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now