In addition to know how to set an environment variable in general you should know, there is a set of scripts in OpenSuse to change all needed settings to use a specific Java version.
In a command shell, being root user, you get a list of already installed Java VMs with command
update-alternatives --list java
Setting all PATH and CLASSPATH variables to use another of the installed VMs is done with
update-alternatives --config java
You can install different VMs from OpenSuse build server. I don't know, if the "update-alternatives" script works with a Java VM not installed through the OpenSuse packet management.