Java 8 is installed on CentOS 7 devbox. I need to use Java 7 to compile cans. So I downloaded and installed Java 7, but it java -versionstill shows Java 8. How can I make sure Java 7 is used to compile jar on the command line?
Here are the steps I took to install Java 7:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
As you can see, it java -versionstill points to Java 8, although it /usr/java/latestpoints to the just downloaded and installed version of Java 7.
The command I want to run is java -jar gs-actuator-service-0.1.0.jar. Can someone show how to change the syntax in this particular command to indicate the version of Java 7? Or do I need to remove Java 8? If so, what specific steps am I taking?