JDK 8 support at DIY cartridge in OpenShift

前端 未结 5 1557
甜味超标
甜味超标 2020-11-30 07:44

I know WildFly cartridge doesn\'t have JDK support, but can I somehow install Java 8 at experimental DIY cartridge? java-1.7.0 is the latest version available at /usr/lib .<

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 08:30

    Hi I want to update the answer above, since I had the same need to update the JDK for my Vert.x application. Since it's totally written in Java8 (Vert.x code looks much better with it) I started to experiment a little with Openshift, until I met the issue that juan reported.

    However I had to fix some stuff and updated to JDK1.8u20:

    // connect with SSH to your application, then
    cd $OPENSHIFT_DATA_DIR 
    wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u20-b26/jdk-8u20-linux-x64.tar.gz
    tar -zxf jdk-8u20-linux-x64.tar.gz
    export PATH=$OPENSHIFT_DATA_DIR/jdk1.8.0_20/bin:$PATH
    export JAVA_HOME=$OPENSHIFT_DATA_DIR/jdk1.8.0_20/
    
    // then depending on your cartridge you need to exec the following command
    echo $JAVA_HOME > $OPENSHIFT_{cartridge}_DIR/env/JAVA_HOME
    
    // in my case was
    // echo $JAVA_HOME > $OPENSHIFT_VERTX_DIR/env/JAVA_HOME
    // for Wildfly I presume it is
    // echo $JAVA_HOME > $OPENSHIFT_WILDFLY_DIR/env/JAVA_HOME
    

提交回复
热议问题