Welcome to JavaRanch.
You can find those libraries easily by googling for them. Jacob is a Java<-->COM wrapper, so in order to use that you'd still need to know how to use
Word's COM objects to do this.
The POI change list claims that support for Word headers and footers has been added recently. That's not yet in any released version, so you need to get the source code out of the repository and compile it yourself. No big deal, though.