How to install and switch to the java version (Unsupported major. minor version 52.0) and major. minorversion in ubuntu

Source: Internet
Author: User

How to install and switch to the java version (Unsupported major. minor version 52.0) and major. minorversion in ubuntu

Recently, we have been working on a dcos (data center operating system). We need to use marathon for process management. Unfortunately, marathon of version 0.6 is very lacking in API. After the version is changed to version 0.15, the prompt "Unsupported major. minor version 52.0 ", which indicates that the java version is too low and java1.8 is required. I was not very familiar with linux and found some materials to solve this problem.

I am using the ubuntu system. The system comes with 1.6 and 1.7 java packages. This can be seen in the/usr/lib/jvm/directory. Next, perform the following steps:

A. install java 1.8 first. You can download it from the official website: composer. After you find the version you want to download, you can download it directly or right-click the link and download it using the wget + URL. The two installation methods are described below

B. if it is tar. tz format, through the command "tar zxvf jdk-8u73-linux-x64.tar.gz-C/usr/lib/jvm/", it can be decompressed to/usr/lib/jvm/, if it is. run directly in bin format and skip variable configuration.

C. vi/etc/profile Add the following content at the end of the file:

Export JAVA_HOME =/usr/lib/jvm/java1.8.0 _ 73

Export JRE_HOME =$ {JAVA_HOME}/jre

Export CLASSPATH =. :$ {JAVA_HOME}/lib :$ {JRE_HOME}/lib

Export PATH = {JAVA_HOME}/bin: $ PATH

D. Update the default jdk.

Update-alternatives -- install/usr/bin/java/usr/lib/jvm/jdk1.8.0 _ 73/bin/java 300

Update-alternatives -- install/usr/bin/javac/usr/lib/jvm/jdk1.8.0 _ 73/bin/javac 300

Switch version

Update-alternatives -- config java

Select the jdk version number from the command line display, and press Enter.

Update-alternatives -- config javac select the same as above

E. Use java-version and javac-version to check whether the version has been changed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.