Jump to content
  • 0
Sign in to follow this  
Fejj

Compile error

Question

[CODE]src\server\model\players\packets\Commands.java:1979: error: cannot find symbol
c2.forceChat("I will allways follow the rules!");
^
symbol: method forceChat(String)
location: variable c2 of type Client
src\server\model\players\packets\Commands.java:1982: error: cannot find symbol
c2.forceChat("Reporting glitches makes the server better
!! :[)");
^
symbol: method forceChat(String)
location: variable c2 of type Client[/CODE]

This is the error i get with my compile source. how do i fix it

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0
You should use eclipse. It auto compiles and will let you click on any error and it will guide you to the correct place. It can also fix certain things with a click of a button. But a good place to start is going to your commands.java file and looking for any wrong syntax with the command. I personally don't know what is causing that error but with eclipse I could fix it and you could to.

Share this post


Link to post
Share on other sites
  • 0
[quote name='expwaste']You should use eclipse. It auto compiles and will let you click on any error and it will guide you to the correct place. It can also fix certain things with a click of a button. But a good place to start is going to your commands.java file and looking for any wrong syntax with the command. I personally don't know what is causing that error but with eclipse I could fix it and you could to.[/QUOTE]

Not entirely. You're making Eclipse out to be something that codes the server for you; while it's nothing but a simple tool that is only as smart as its user. It's encouraged to learn from Eclipse, not just use it.

OT: I believe you're missing imports or because c2 isn't recognized as being the second person.

Share this post


Link to post
Share on other sites
  • 0
Try
[code]

Client c2 = (Client)PlayerHandler.players[j];
[/code]

Share this post


Link to post
Share on other sites
  • 0
[quote name='Fejj'][CODE]src\server\model\players\packets\Commands.java:1979: error: cannot find symbol
c2.forceChat("I will allways follow the rules!");
^
symbol: method forceChat(String)
location: variable c2 of type Client
src\server\model\players\packets\Commands.java:1982: error: cannot find symbol
c2.forceChat("Reporting glitches makes the server better
!! :[)");
^
symbol: method forceChat(String)
location: variable c2 of type Client[/CODE]

This is the error i get with my compile source. how do i fix it[/QUOTE]

[quote name='falconpunch']Not entirely. You're making Eclipse out to be something that codes the server for you; while it's nothing but a simple tool that is only as smart as its user. It's encouraged to learn from Eclipse, not just use it.

OT: I believe you're missing imports or because c2 isn't recognized as being the second person.[/QUOTE]

[code]
method forceChat(String)
[/code]

you don't have forceChat implemented or it's not configured to support the second person.

Share this post


Link to post
Share on other sites
  • 0
where do i put that code?

Share this post


Link to post
Share on other sites
  • 0
[quote name='Fejj']where do i put that code?[/QUOTE]

That's not a fully functioning piece of code, it's incomplete. He's saying you don't have it, and you need it.

Post the piece of the commands.java where it's giving you the error please, like that error or the entire class.

Share this post


Link to post
Share on other sites
  • 0
[quote name='falconpunch']Not entirely. You're making Eclipse out to be something that codes the server for you; while it's nothing but a simple tool that is only as smart as its user. It's encouraged to learn from Eclipse, not just use it.

OT: I believe you're missing imports or because c2 isn't recognized as being the second person.[/QUOTE]

I said it can also "fix certain things" no where in that did I say it codes the server for you.

Share this post


Link to post
Share on other sites
  • 0
[quote name='Fejj']where do i put that code?[/QUOTE]

lulzs3 may be right, though before jumping to that conclusion, Id suggest seeing if c2 is a valid function callback as high105 posted, check and see if that's added.


If it isn't added then yeah, it is missing.

It could only be stating that forcechat is missing because it has no way to clarify where the client is being called from.

but hey, I may be wrong, half asleep and what not working 8 hours a day.. lol

Share this post


Link to post
Share on other sites
  • 0
[quote name='expwaste']I said it can also "fix certain things" no where in that did I say it codes the server for you.[/QUOTE]
[QUOTE]
[SIZE=5]It can also fix certain things with a click of a button.[/SIZE] [SIZE=5] I personally don't know what is causing that error but with eclipse I could fix it and you could to.[/SIZE]
[/QUOTE]

This is basically saying eclipse codes for you and does fixes without you thinking

Share this post


Link to post
Share on other sites
Sign in to follow this  

×