Give either the absolute path of the script, or path relative to one of your script roots. Relative paths are more portable and make switching servers easier.
If your scripts/classes have a package
declaration, obviously, you will need the correct directories under there.
Simple built-in scripts like Simple Scripted Post Function can be used to avoid most of the boilerplate in writing a post function.