For a specific compilation that requires a (non-default /etc/alternatives/java) JVM, consider prefixing the mvn command with JAVA_HOME like this,
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/ mvn package
Here we assume the default is Java 8, whereas for the specific project at hand we require Java 7.