Jump to content
  • 0
Sign in to follow this  
InsanityPk

[HELP]1 error while compiling[HELP]

Question

So I fixed the other 2 errors, but now I have 1 error...
Here it is:

[CODE]Compiling Insanity 659
src\com\rs2hd\packethandler\CommandsPacketHandler.java:1212: error: reached end
of file while parsing
}
^
1 error
Successfully compiled Insanity 659
Press any key to continue . . .[/code]

Here is my CommandsPacketHandler.java if it helps:

[url]http://pastebin.com/vTQKJtTf[/url]

Thanks! (+rep and thanked). Edited by InsanityPk

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
Okay, let me explain what this error means :)

Basicly, Java will screw up with errors, so it's warning you that an error might occur if that file isn't found.. So it's asking you to tell it what to do, If it doesn't find the file..

FileNotFoundException; is what might Happen (The file might not be found)

So to fix it, what you need to do, it surround your statement with Try and Catch, so it will try to find the file, if it doesn't work, then it won't kill itself trying to get it to work.. It'l just move on.. If you understand me.

[CODE]
if(cmd[0].equals("::backup")) {
try {
XStream xstream = XStreamUtil.getXStream();
xstream.toXML(player, new FileOutputStream("data/backups/"+player.getPlayerDetails().getUsername()+".xml"));
player.sm("Succesfully make a backup of "+player.getDisplayName()+".");
} catch(FileNotFoundException e) {
player.sm("Didn't make a backup of "+player.getDisplayName()+". Backup file was not found!");
}
}
[/CODE]

I hope that works for you.

If it doesn't then I am sorry, Im just trying to help because not many people help in the help section.

Share this post


Link to post
Share on other sites
  • 0
Thanks, fixed that, but now I've got another error..

P.S: Thanked.

EDIT: Here's the error :P:

[code]Compiling Insanity 659
src\com\rs2hd\packethandler\CommandsPacketHandler.java:1212: error: reached end
of file while parsing
}
^
1 error
Successfully compiled Insanity 659
Press any key to continue . . .[/code]

Share this post


Link to post
Share on other sites
  • 0
You need another "}" Somewhere. Try throw one in at the end. if not, you might have to check all your other statements for where it goes..

Share this post


Link to post
Share on other sites
  • 0
@ Draesia

i like this :
I do my best to help people. However if my advice doesn't work, I'm sorry, I just want to help (Noone helps in the help section ARGH!)

:rolleyes:

Share this post


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

×