OpenShift supports both Java 6 and Java 7 to run your applications. By default, all the Java applications use OpenJDK 7, but you can configure your application to use OpenJDK 6 as well. To get the exact version of your Java installation, you can SSH into the application gear and run the java -version
command or run the following command:
$ rhc ssh --app jobstore --command "java -version"
In this recipe, you will learn how you can choose among different supported versions of Java.
Note
This recipe will work with all the four supported Java cartridges (Apache Tomcat 6, Apache Tomcat 7, JBoss AS7, and JBoss EAP).
Perform the following steps to switch to OpenJDK 6: