Can you help me work out why I am getting so many Java errors in my compiler?

Chetan Sood October 10, 2012
Pinterest Stumbleupon Whatsapp
Ads by Google

Alright so i’m coding a Runescape Private Server and im getting loads (82) errors on my compiler. I’ve already asked a similar question but all I got was a response that said client is not equal to client and i still have no clue on how to fix this. Here’s a snippet of my code that has the couple errors in it:

 if (System.currentTimeMillis() - lastMassSave > 10000) {
 for(Player p : playerHandler.players) {
 if(p == null)
 continue;
 PlayerSave.saveGame((Client)p);
 System.out.println("Saved game for " + p.playerName + ".");
 lastMassSave = System.currentTimeMillis();
 }
}
 }
 } catch (Exception ex) {
 ex.printStackTrace();
 System.out.println("A fatal exception has been thrown!");
 for(player p : playerHandler.players) {
 if(p == null)
 continue;
 playerSave.saveGame((Client)p);
 System.out.println("Saved game for " + p.playerName + ".");
 }
 }

So now heres my error in those few lines:

 Server.java:207: error: cannot find symbol
 for(Player p : playerHandler.players) {
 ^
 symbol: class Player
 location: class Server
 Server.java:210: error: cannot find symbol
 PlayerSave.saveGame((Client)p);
 ^
 symbol: class Client
 location: class Server
 Server.java:210: error: cannot find symbol
 PlayerSave.saveGame((Client)p);
 ^
 symbol: variable PlayerSave
 location: class Server
 Server.java:220: error: cannot find symbol
 for(player p : playerHandler.players) {
 ^
 symbol: class player
 location: class Server
 Server.java:223: error: cannot find symbol
 playerSave.saveGame((Client)p);
 ^
 symbol: class Client
 location: class Server
 Server.java:223: error: cannot find symbol
 playerSave.saveGame((Client)p);
 ^
 symbol: variable playerSave
 location: class Server

Any ideas?

  1. Heli Dmitry
    October 17, 2012 at 4:05 am

    Check the character casings, like the Player type on the 2nd for-loop. Check your access modifiers as well, and if you may need an import statement on the classes that are not part of the package you're working on. There's not much to see in your code snippet. Maybe the root of the errors goes deeper to the classes that you used.

  2. Sachin Sharma`
    October 10, 2012 at 6:08 pm

    Try reinstalling Your JDK or update to latest Version this might help resolve your problems also you can try using other IDE or using an online compiler to check if it is a problem with your code or with your JDK....her is a link to try......http://ideone.com/

  3. Dimal Chandrasiri
    October 10, 2012 at 5:21 pm

    check your coding is correct.. I mean the uppercase and lower case in class names. all of these errors indicate that, the compiler cannot find the necessary classes to compile I guess. try to recheck for upper and lowercase class names. as well as, object names.

  4. Grr
    October 10, 2012 at 3:14 pm

    Check at the best Java forum below
    http://www.coderanch.com/forums

  5. Sahil Dave
    October 10, 2012 at 7:42 am

    It would be better to ask your problem in JAVA specific forums like

    http://www.dreamincode.net/forums/forum/32-java/

    Try it!