Installing Java 7 on Ubuntu

后端 未结 10 1365
温柔的废话
温柔的废话 2020-11-29 14:12

to install java I have always used the classic way from the terminal. I would like to install java manually. I placed the folder of the JDK on the desk and I set environment

相关标签:
10条回答
  • 2020-11-29 15:09

    Oracle Java 1.7.0 from .deb packages

    wget https://raw.github.com/flexiondotorg/oab-java6/master/oab-java.sh
    chmod +x oab-java.sh
    sudo ./oab-java.sh -7
    sudo apt-get update
    sudo sudo apt-get install oracle-java7-jdk oracle-java7-fonts oracle-java7-source 
    sudo apt-get dist-upgrade
    

    Workaround for 1.7.0_51

    There is an Issue 123 currently in OAB and a pull request

    Here is the patched vesion:

    wget https://raw.github.com/ladios/oab-java6/master/oab-java.sh
    chmod +x oab-java.sh
    sudo ./oab-java.sh -7
    sudo apt-get update
    sudo sudo apt-get install oracle-java7-jdk oracle-java7-fonts oracle-java7-source 
    sudo apt-get dist-upgrade
    
    0 讨论(0)
  • 2020-11-29 15:12

    Oracle as well as modern versions of Ubuntu have moved to newer versions of Java. The default for Ubuntu 20.04 is OpenJDK 11 which is good enough for most purposes.

    If you really need it for running legacy programs, OpenJDK 8 is also available for Ubuntu 20.04 from the official repositories.

    If you really need exactly Java 7, the best bet as of 2020 is to download a Zulu distribution. The easiest to install if you have root privileges is the .DEB version, otherwise download the .ZIP one.

    https://www.azul.com/downloads/zulu-community/?version=java-7-lts&os=ubuntu&architecture=x86-64-bit&package=jdk

    0 讨论(0)
  • 2020-11-29 15:14
    Open Applicaction -> Accessories -> Terminal
    
    Type commandline as below...
    
    sudo apt-get install openjdk-7-jdk
    
    Type commandline as below...
    
    apt-cache search jdk
    
    (Note: openjdk-7-jdk is symbolically used here. You can choose the JDK version as per your requirement.)
    
    For "JAVA_HOME" (Environment Variable) type command as shown below, in "Terminal" using your installation path...
    
    export JAVA_HOME=/usr/lib/jvm/java-7-openjdk
    
    (Note: "/usr/lib/jvm/java-7-openjdk" is symbolically used here just for demostration. You should use your path as per your installation.)
    
    For "PATH" (Environment Variable) type command as shown below, in "Terminal" using your installation path...
    
    export PATH=$PATH:/usr/lib/jvm/java-7-openjdk/bin
    
    (Note: "/usr/lib/jvm/java-7-openjdk" is symbolically used here just for demostration. You should use your path as per your installation.)
    
    Check for "open jdk" installation, just type command in "Terminal" as shown below
    
    javac -version
    
    0 讨论(0)
  • 2020-11-29 15:15
    sudo apt-get update
    sudo apt-get install openjdk-7-jdk
    

    and if you already have other JDK versions installed

    sudo update-alternatives --config java
    

    then select the Java 7 version.

    0 讨论(0)
提交回复
热议问题