"cannot resolve symbol"

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.
GurkanGerAsked:
Who is Participating?
 
ee_ai_constructConnect With a Mentor Commented:
PAQed, with points refunded (100)

ee_ai_construct
Community Support Moderator
0
 
CEHJCommented:
If you're recompiling the result of your decompile, the former has probably broken it
0
 
zzynxSoftware engineerCommented:
Post the code where the error occurs
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
CEHJCommented:
Sorry - i mean the decompile has probably broken it
0
 
zzynxSoftware engineerCommented:
>> I'm decompiling it (ok)
You really mean DEcompile?
0
 
CEHJCommented:
>>Sorry - i mean the decompile has probably broken it

Which is of course a commonplace occurrence
0
 
GurkanGerAuthor Commented:
Dear zzynx,

The decompiler i'm using is "DJ Java Decompiler"
0
 
zzynxSoftware engineerCommented:
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
 
WebstormCommented:

Most Java decompiler don't support inner classes.
You must also decompile inner classes ( __the_class__$ ... .class )
0
 
GurkanGerAuthor Commented:
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
 
CEHJCommented:
0
 
CEHJCommented:
That just means that class ChatPanel is not available to the compiler in the classpath
0
 
zzynxSoftware engineerCommented:
maybe you have to put all source files in one package/directory "test"

Then start each source file with:

package test;
0
 
CEHJCommented:
What package does ChatMeeting think it's in - if any?
0
 
WebstormCommented:

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
 
GurkanGerAuthor Commented:
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
 
zzynxSoftware engineerCommented:
>> 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
 
CEHJCommented:
>>Now i will try:

I too don't know how that's going to help. And you didn't answer my question...
0
 
CEHJCommented:
...oh and hold off on downloading any other decompilers too - faulty kit is not part of your problem from what i can see
0
 
GurkanGerAuthor Commented:
>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
 
WebstormCommented:
>> 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
 
CEHJCommented:
Well you'll just have to make sure that all those private member variable classes at least are in the same directory
0
 
WebstormCommented:
>> 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
 
CEHJCommented:
All classes are in a package in fact. It just happens that ChatMeeting is in the 'default package'
0
 
GurkanGerAuthor Commented:
>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
 
CEHJCommented:
That should be OK
0
 
CEHJCommented:
...although it might makes things easier if they were
0
 
GurkanGerAuthor Commented:
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
 
CEHJCommented:
Have you tried just

javac *.java

in the source directory?
0
 
GurkanGerAuthor Commented:
>Have you tried just javac *.java

Okay, i tried and the answer was 87 errors 8-)
Sorry.
0
 
CEHJCommented:
Right. Better start with just ChatMeeting then
0
 
GurkanGerAuthor Commented:
>Right. Better start with just ChatMeeting then

Yes?
0
 
GurkanGerAuthor Commented:
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
 
CEHJCommented:
..which is what you're already doing isn't it? Where are you at now?
0
 
GurkanGerAuthor Commented:
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
 
zzynxSoftware engineerCommented:
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
All Courses

From novice to tech pro — start learning today.