gpt4 book ai didi

java - 在 Ubuntu 上安装 Java 7

转载 作者:IT老高 更新时间:2023-10-28 12:14:54 25 4
gpt4 key购买 nike

Note: This question was asked before Oracle made the OpenJDK the free version of the Oracle JDK, and the historic answers reflect that. As of 2022 you should not use Java 7 unless you must for projects which cannot run on OpenJDK 8.

为了安装java,我一直使用终端的经典方式。我想手动安装java。我将 JDK 的文件夹放在桌面上,并设置了环境变量(PATH、CLASSPATH 和 JAVA_HOME)。从终端,如果我输入 java -version 我会被打印出来

foralobo@ubuntu-vincy:~$ java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

但是当我尝试安装 eclipse 或 netbeans 时,系统警告说机器上没有安装 java。

完成手动安装缺少什么?(Ubuntu 13.04)

最佳答案

This answer used to describe how to install Oracle Java 7. This no longer works since Oracle end-of-lifed Java 7 and put the binary downloads for versions with security patches behind a paywall. Also, OpenJDK has grown up and is a more viable alternative nowadays.

在 Ubuntu 16.04 及更高版本中,Java 7 不再可用。通常你最好安装 Java 8(或 9)。

sudo apt-get install openjdk-8-jre

或者,如果你也想要编译器,获取 jdk:

sudo apt-get install openjdk-8-jdk

在 Trusty 中,目前安装 Java 7 最简单的方法是安装 OpenJDK 包:

sudo apt-get install openjdk-7-jre

或者,对于 jdk:

sudo apt-get install openjdk-7-jdk

如果您专门在不再支持 Java 7 的 Ubuntu 版本上寻找 Java 7,请参阅 https://askubuntu.com/questions/761127/how-do-i-install-openjdk-7-on-ubuntu-16-04-or-higher .

关于java - 在 Ubuntu 上安装 Java 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16263556/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com