First of all, you're not telling us what error you're receiving so how should we be able to help you?
Secondly, as @Slut spotted, you have a semicolon at the declaration of your onLoop method. Your IDE most likely tells you that this is not possible. If you couldn't figure this out yourself this probably means that you don't have a single clue about what you're doing. I'd like to suggest for you to learn Java first before trying to write a script .
We're more than willing to help out those in need of assistance but we expect them to at least be able to handle syntax and have at least some knowledge about the language.