GurkanGer
asked on
"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.
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.
If you're recompiling the result of your decompile, the former has probably broken it
Post the code where the error occurs
Sorry - i mean the decompile has probably broken it
>> I'm decompiling it (ok)
You really mean DEcompile?
You really mean DEcompile?
>>Sorry - i mean the decompile has probably broken it
Which is of course a commonplace occurrence
Which is of course a commonplace occurrence
ASKER
Dear zzynx,
The decompiler i'm using is "DJ Java Decompiler"
The decompiler i'm using is "DJ Java Decompiler"
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
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
Most Java decompiler don't support inner classes.
You must also decompile inner classes ( __the_class__$ ... .class )
ASKER
The code and error follows:
import java.awt.*;
import java.applet.*;
import java.awt.image.*;
import java.awt.event.*;
import com.lotus.sametime.core.co mparch.*;
import com.lotus.sametime.core.co nstants.*;
import com.lotus.sametime.core.ty pes.*;
import com.lotus.sametime.communi ty.*;
import com.lotus.sametime.places. *;
import com.lotus.sametime.awarene ssui.*;
import com.lotus.sametime.awarene ssui.place list.*;
/**
* 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.ja va:20: cannot resolve symbol
symbol : class ChatPanel
location: class ChatMeeting
private ChatPanel m_chatPanel;
^
import java.awt.*;
import java.applet.*;
import java.awt.image.*;
import java.awt.event.*;
import com.lotus.sametime.core.co
import com.lotus.sametime.core.co
import com.lotus.sametime.core.ty
import com.lotus.sametime.communi
import com.lotus.sametime.places.
import com.lotus.sametime.awarene
import com.lotus.sametime.awarene
/**
* 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.ja
symbol : class ChatPanel
location: class ChatMeeting
private ChatPanel m_chatPanel;
^
That just means that class ChatPanel is not available to the compiler in the classpath
maybe you have to put all source files in one package/directory "test"
Then start each source file with:
package test;
Then start each source file with:
package test;
What package does ChatMeeting think it's in - if any?
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 ?
ASKER
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.
Now i will try:
>Then start each source file with:
>package test;
And then JAD.
Hope to return with positive answer.
>> 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
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
>>Now i will try:
I too don't know how that's going to help. And you didn't answer my question...
I too don't know how that's going to help. And you didn't answer my question...
...oh and hold off on downloading any other decompilers too - faulty kit is not part of your problem from what i can see
ASKER
>What package does ChatMeeting think it's in - if any?
ChatMeeting is not in any package.
I'm calling this applet from a cab.
ChatMeeting is not in any package.
I'm calling this applet from a cab.
>> 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.
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.
Well you'll just have to make sure that all those private member variable classes at least are in the same directory
>> 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.
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.
All classes are in a package in fact. It just happens that ChatMeeting is in the 'default package'
ASKER
>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.
No; the classes are not in the same directory, but they are defined in classpath.
That should be OK
...although it might makes things easier if they were
ASKER
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$CommunityEven tsListener .java
>ChatMeeting$ParticipantLi stListener .java
>ChatMeeting$PlaceEventsLi stener.jav a
>ChatMeeting.java
>ChatPanel$ChatAreaEventsL istener.ja va
>ChatPanel$MyMsgEventsList ener.java
>ChatPanel$TextFieldEventL istener.ja va
>ChatPanel.java
Also I have another 2 cab files, and 2 jar files which I've been already added to classpath while compiling.
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$CommunityEven
>ChatMeeting$ParticipantLi
>ChatMeeting$PlaceEventsLi
>ChatMeeting.java
>ChatPanel$ChatAreaEventsL
>ChatPanel$MyMsgEventsList
>ChatPanel$TextFieldEventL
>ChatPanel.java
Also I have another 2 cab files, and 2 jar files which I've been already added to classpath while compiling.
Have you tried just
javac *.java
in the source directory?
javac *.java
in the source directory?
ASKER
>Have you tried just javac *.java
Okay, i tried and the answer was 87 errors 8-)
Sorry.
Okay, i tried and the answer was 87 errors 8-)
Sorry.
Right. Better start with just ChatMeeting then
ASKER
>Right. Better start with just ChatMeeting then
Yes?
Yes?
ASKER
I decompiled the code with JAD, and i got different errors:
D:\Lotus\chatmeeting\ChatM eeting.jav a:51: cannot resolve symbol
symbol : method bindToPlace (com.lotus.sametime.places .Place)
location: class ChatPanel
m_chatPanel.bindToPlace(pl aceevent.g etPlace()) ;
^
D:\Lotus\chatmeeting\ChatM eeting.jav a:167: cannot resolve symbol
symbol : constructor ChatPanel (com.lotus.sametime.core.c omparch.ST Session,ja v
a.applet.AppletContext)
location: class ChatPanel
m_chatPanel = new ChatPanel(m_session, getAppletContext());
^
D:\Lotus\chatmeeting\ChatM eeting.jav a:168: cannot resolve symbol
symbol : method add (ChatPanel,java.lang.Strin g)
location: class java.awt.Panel
panel3.add(m_chatPanel, "Center");
^
D:\Lotus\chatmeeting\ChatM
symbol : method bindToPlace (com.lotus.sametime.places
location: class ChatPanel
m_chatPanel.bindToPlace(pl
^
D:\Lotus\chatmeeting\ChatM
symbol : constructor ChatPanel (com.lotus.sametime.core.c
a.applet.AppletContext)
location: class ChatPanel
m_chatPanel = new ChatPanel(m_session, getAppletContext());
^
D:\Lotus\chatmeeting\ChatM
symbol : method add (ChatPanel,java.lang.Strin
location: class java.awt.Panel
panel3.add(m_chatPanel, "Center");
^
..which is what you're already doing isn't it? Where are you at now?
ASKER
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
The 100 points goes to nobody.
The answer was:
put a . (yes a dot) in the beginnig of the classpath.
Thanks to all
At https://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.
to ask to delete this question and to refund you the points.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.