I know this is an old thread, but still... I've been bitten by that thing... so I prefer to give the correct solution.
As johnnoel said, you can use the method ODServer.getVersion().
BUT and that's important to know, when you compile java, it will try to optimize the output for performance.
And since the version of ODWEK is stored as a constant, and the getVersion() basically is returning that constant... the java compiled code will replace all ODServer.getVersion() with the ODWEK version you are using in your development environment.
Example: You are using ODWEK 9.0.0.1 to develop. You compile your code, and run it in a test environment with ODWEK 8.5.0.7... you test will still show ODWEK Version 9.0.0.1 instead of 8.5.0.7
This is really NASTY !!! And this was solved with ODWEK 9.5.
How to solve that, and ensure that you always have the version of ODWEK you are running, if you haven't compiled your Java with ODWEK 9.5?
Add .intern()
-> ODServer.getVersion().intern()
Hope that helps someone!
Yours sincerely,
Alessandro