Skip to main content
Improved formatting, Enhanced Answer
Source Link

For Centos 7 or RHEL 7: run # alternatives --config java output: Selection Command ---------------------------------------------- I faced this problem while installing pycharm- * 1 /usr/lib/jvm/javacommunity-1.72017.0-openjdk-1.7.0.75-2.5.4.2.el7_0 on RHEL 7.x86_64 /jre/bin/java 2 /usr/lib/jvm/jre-1.6.0-openjdk Error was:

Unsupported Java Version: Cannot start under Java 1.7.0_75-mockbuild_2015_01_16_09_12-b00: Java 1.8 or later is required

I Found that the required version of java is installed but not detected.x86_64/bin/javathen I searched over internet and Used the following to resolve this problem:

  • 3 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-2.b13.el7.x86_64/jre/bin/java 4 /usr/java/jdk1.8.0_91/jre/bin/java

    Enter to keep the current selection[+], or type selection number:

# alternatives --config java

output:

Selection    Command
-----------------------------------------------
*  1           /usr/lib/jvm/java-1.7.0-openjdk1.7.0.75-2.5.4.2.el7_0.x86_64 /jre/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
 + 3           /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-2.b13.el7.x86_64/jre/bin/java
   4           /usr/java/jdk1.8.0_91/jre/bin/java

Enter to keep the current selection[+], or type selection number:

Now enter the number of your desired version and press enter key as follows: Enter to keep the current selection[+], or type selection number:4 Check

Enter to keep the current selection[+], or type selection number:4

Check Java version: java -version

# java -version

Output:

java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

For Centos 7 or RHEL 7: run # alternatives --config java output: Selection Command ----------------------------------------------- * 1 /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75-2.5.4.2.el7_0.x86_64 /jre/bin/java 2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java

  • 3 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-2.b13.el7.x86_64/jre/bin/java 4 /usr/java/jdk1.8.0_91/jre/bin/java

    Enter to keep the current selection[+], or type selection number:

Now enter the number of your desired version and press enter key as follows: Enter to keep the current selection[+], or type selection number:4 Check Java version: java -version

For Centos 7 or RHEL 7: I faced this problem while installing pycharm-community-2017.1.4 on RHEL 7.1. Error was:

Unsupported Java Version: Cannot start under Java 1.7.0_75-mockbuild_2015_01_16_09_12-b00: Java 1.8 or later is required

I Found that the required version of java is installed but not detected.then I searched over internet and Used the following to resolve this problem:

# alternatives --config java

output:

Selection    Command
-----------------------------------------------
*  1           /usr/lib/jvm/java-1.7.0-openjdk1.7.0.75-2.5.4.2.el7_0.x86_64 /jre/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
 + 3           /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-2.b13.el7.x86_64/jre/bin/java
   4           /usr/java/jdk1.8.0_91/jre/bin/java

Enter to keep the current selection[+], or type selection number:

Now enter the number of your desired version and press enter key as follows:

Enter to keep the current selection[+], or type selection number:4

Check Java version:

# java -version

Output:

java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
Source Link

For Centos 7 or RHEL 7: run # alternatives --config java output: Selection Command ----------------------------------------------- * 1 /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75-2.5.4.2.el7_0.x86_64 /jre/bin/java 2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java

  • 3 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-2.b13.el7.x86_64/jre/bin/java 4 /usr/java/jdk1.8.0_91/jre/bin/java

    Enter to keep the current selection[+], or type selection number:

Now enter the number of your desired version and press enter key as follows: Enter to keep the current selection[+], or type selection number:4 Check Java version: java -version