You could architect your application so you use a common interface that is smart enough to make use of either the v7 or v8 client stubs, which will be different.
The endpoint URLs will be different so you will need a method to handle that. You could make use of a config file to identify which one is in use or you could attempt a readDatabaseInstances message using the v7 version of the URL and if it failed use the v8 version of the URL. One of them should work if everything is OK (correct username, password, domain and port for server). Then you will know whether you are dealing with v8 or v7.
When deploying, you'll need to know which P6 Web services client to package with your application. Any decent Java developer would know what to do. In fact they could probably dynamically load the correct P6 Web Service client stub too.