Update with java update 7 to 8 in Tomcat 7 (JBoss EWS 2.0) Cartridge

I am new to Openshift and I created a server instance using the Tomcat 7 cartridge (JBoss EWS 2.0) for my spring download web application.

Originally, the web application used JDK7 and worked great in Openshift. Now, for some improvement, we need to switch to JDK8.

I tried a google search about changing JAVA_HOME in JDK8, and I tried most of the solutions, but I can't get it to work.

  • Trial Solution 1 . A start file has been created under app-root/runtime/repo/.openshift/action_hooks/ with the contents below.

    #!/bin/bash export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0 export PATH=$JAVA_HOME:$PATH

    In addition, the file has a resolution of +x .

  • Trial Solution 2 . A java8 token was java8 under app-root/runtime/repo/.openshift/markers and jbossews/template/.openshift/markers .

The above solutions do not work. Another option is a DIY cartridge, which may work, but I do not want to create a new application and move everything there.

EDIT

Below is the directory structure

Directory structure

Note that I created this application using the open UI offset and not using the rhc command.

I beg you, please.

thanks

+5
source share
2 answers

I had to โ€œtrickโ€ a bit to enable java 8, as the โ€œjava8โ€ token does not seem to work. Look at the JbossEWS cartridge source:

 function export_java_home() { if marker_present "java7"; then export JAVA_HOME=$OPENSHIFT_JBOSSEWS_JDK7 else export JAVA_HOME=$OPENSHIFT_JBOSSEWS_JDK6 fi } 

So my solution / workaround:

  • Set the environment OPENSHIFT_JBOSSEWS_JDK7 var to point to jdk8 instead of jdk7:
  rhc env set OPENSHIFT_JBOSSEWS_JDK7 = "/ etc / alternatives / java_sdk_1.8.0" -a YOURAPPNAME
  • Add the java7 marker to the .openshift/markers directory.
+3
source

Sounds like poor planning. It is assumed that your platform supports Java-8 before writing code that requires it. From the Openshift documentation:

3.2. Java environment supported by JBoss Enterprise Application 6 The JBoss Enterprise Application Platform 6 requires Java 6 or Java 7. A list of supported Java environments can be found at http://www.jboss.com/products/platforms/application/supportedconfigurations/ . Development requires the Java Development Kit (JDK), and the Java Runtime Environment (JRE) is required to run the JBoss Enterprise Application Platform.

0
source

Source: https://habr.com/ru/post/1243405/


All Articles